Playing with GRASS vector displays
####Trying with a vector map of Spain and Portugal admin boundaries:
# column attributes
v.info -c map=SpainPort
INTEGER|ObjectID
CHARACTER|FIPS_ADMIN
CHARACTER|GMI_ADMIN
CHARACTER|ADMIN_NAME
CHARACTER|FIPS_CNTRY
CHARACTER|GMI_CNTRY
CHARACTER|CNTRY_NAME
INTEGER|POP_ADMIN
CHARACTER|TYPE_ENG
CHARACTER|TYPE_LOC
DOUBLE PRECISION|SQKM
DOUBLE PRECISION|SQMI
INTEGER|COLORMAP
INTEGER|LABEL_FLAG
# extract last 2 rows of the attrbute table to see what the above fields really look like
db.select | tail -n 2
2584|2583|NZ|NZL-OTG|Otago|NZ|NZL|New Zealand|-99999|County|County|33597.33|12971.93|6|0
2585|2584|NZ72|NZL-STH|Southland|NZ|NZL|New Zealand|34612|County|County|31711.77|12243.91|11|0
#display the map
#the problem here is that the column to be displayed as color needs to be numeric
#and i dont know how to control the intervals..quite annoying
# here i tried to use the COLORMAP field, which varies from 1 to 12…but it still needs work..
d.legend map=SpainPort
##Attribute table joins : lowseries.csv to GRASS vector map countyCA
v.info -c countyCA
CHARACTER|NAME
INTEGER|NUM
head lowseries.csv | head -n 2
Alameda,3,5,6,5,4,1,-1,-4,-7,-12,-16,-20,-24,-27,-29,-31,-32,-32
# So join on COUNTY field from the csv file to NAME field from vector map
##PROBLEM v.db.join does not work on dbf and i dont really know how to use pgsql
v.db.join countyCA col=NAME otab=lowseries.csv ocol=COUNTY
ERROR: JOIN is not supported for tables stored in DBF format.
# try importing a vector that already has the columns of interest
v.in.ogr dsn=CACountyLL84.shp output=CountyPop type=boundary
WHAT WORKED
Displaying column types/names for database connection of layer 1:
CHARACTER|NAME
INTEGER|NUM
CHARACTER|COUNTY
DOUBLE PRECISION|countynum
DOUBLE PRECISION|p2000
DOUBLE PRECISION|pc2010
DOUBLE PRECISION|pc2015
DOUBLE PRECISION|pc2020
DOUBLE PRECISION|pc2025
DOUBLE PRECISION|pc2030
—
—-d.thematic.area
how to assign a constant color scheme to each map (that spans the min and max of all columns); i guess i was looking for something as simple as setting color rules like with raster data.
If you want constant class breaks, i.e. the same class number and amplitudes linked to the same colors, then you can just manually provide breaks and colors in d.thematic.area.
n – how to refer to each attribute column by column number in a loop (d.vect.thematic and d.thematic.area seem to need column name as attribute)
(assuming you are in a *nix environment with a shell):
for col in `v.info -c MapName`; do d.thematic.area …. column=$col; done
(note the backticks around the v.info command))