[GRASS5] script for displaying greyscale vector maps according to given class boundaries

M Lennert fa1079 at qmul.ac.uk
Thu Jan 24 03:25:17 EST 2002


Hello all,

attached you will find a little script that makes displaying vector 
area maps according to defined class boundaries (=thematic 
maps) easier (it uses the new d.area catnum feature of Grass 
5.0.0pre3). Up to now its only in greyscale, but I'm planning on 
enhancing it. Feedback is very welcome. 

Usage: d.area.class map=name catfile=name 
classes=boundary1[,boundary2,..]

Parameters:

map = vector map to display

catfile = variable file with 2 columns seperated by whitespace: 
1=category 2=variable by which to class)

classes = class boundaries separated by comma, starting with 
boundary between class 1 and 2 and ending with boundary 
between class max-1 and max

example:

d.area.class map=communes catfile=ACP_scores1 classes=-
0.85421,-0.48965,-0.14563,0.35487,0.63214

This would take the file ACP_scores1 as input and display 
'communes' with its areas divided into 6 classes:

1: < -0.85421
2: -0.85421 -> -0.48965
3: -0.48964 -> -0.14563
4: -0.14562 -> 0.35487
5: 0.35488 -> 0.63214
6: > 0.63215 


The catfile should look like this:

catnum1 variable
catnum2 variable
catnum3 variable
etc... (can be integer or floating point variable values).

So in my example it would be

11001 -0.14568
11002 0.32287
11003 -0.24587
etc...

The script then displays each category in greyscale, first=lightest, 
last =darkest. It can be used in conjunction with the PNG driver in 
order to rapidly create thematic map output.

Moritz



More information about the grass-dev mailing list