[GRASSLIST:3913] d.vect and postgresql in 5.7

Craig Aumann caumann at ualberta.ca
Wed Jul 14 17:47:52 EDT 2004


I have attribute data linked into a shape file using PostgreSQL.  My
problem is I can't figure out how to produce a map of a given attribute
in the associated postgresql database.  

Here's what I've done to set things up:

--------------------------
db.connect driver=pg database="dbname=alpac_netdown,user=caumann"

SHPDIR=/home/caumann/amedata/netdown/L3/coverages/
DBFDIR=/home/caumann/amedata/netdown/L3/data/

v.in.ogr -o dsn="$SHPDIR" \
    output=l3a_fin_n83 layer=l3a_fin_n83

db.copy from_driver=dbf from_database=$DBFDIR \
    from_table=l3a_net_final \
    to_driver=pg to_database="dbname=alpac_netdown,user=caumann" \
    to_table=l3a_fin_n83_att

v.db.connect -o  map=l3a_fin_n83 table=l3a_fin_n83_att field=1 \ key=OID
driver=pg database="dbname=alpac_netdown,user=caumann"

v.db.connect -p map=l3a_fin_n83
--------------------------

## cgrp is one of the columns in the database and it has has 5 
## values: C, D, CD,  DC and "" or NULL or missing.

Now I want to produce a map with different colors for each of the
different values of cgrp for each polygon in the map. The map should
have 4 (or 5?) colors.  

-----------

d.vect -c map=l3a_fin_n83 field=1 type=area display=attr attrcol=cgrp

-----------

The above produces a map with a large number of colors and is clearly
not correct.  

-------
d.vect map=l3a_fin_n83 field=1 type=area display=shape attrcol=cgrp \
    where="cgrp='D'" col=red
------

Produces nothing.  Why doesn't it like my query?

I'm sure there's a way to do this, I just can't figure out the different
flags to d.vect.  

Many Thanks!
Craig




More information about the grass-user mailing list