[GRASS-user] displaying many thematic maps from one vector dataset

Moritz Lennert mlennert at club.worldonline.be
Fri Apr 3 02:54:39 EDT 2009


On 03/04/09 00:23, Vishal Mehta wrote:
> Hello all,
> 
> I am better at GRASS raster capabilities than with GRASS vector 
> handling, so I am writing to get your help.
> 
> What I want to do is this:
> 1. I will have one vector dataset of watersheds. Each record is a 
> polygon, an individual watershed. There are, apart from the usual cat 
> fields, 52 attribute columns. Each attribute column is modeled weekly 
> snow depth.
> 
> 2. I need to automate the display and export to png of 52 thematic 
> images - one for each week/column - keeping the color scheme constant 
> throughout. Then all of the images will be packaged into a kml animation.
> 
> I know how to do the above starting from a stack of GRASS rasters, but 
> am not quickly getting a handle on displaying GRASS vectors 
> consistently. I've tried d.vect and d.vect.thematic. I havent tried 
> d.thematic.area yet.
> 
> The main issues are that I dont know:
> - 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.

>  
> - 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))

Moritz


More information about the grass-user mailing list