d.vect displays GRASS vector data in the active frame on the graphics monitor.


d.vect can simply be used typing d.vect map=vector_map. There are a large variety of optional parameters which allow the user to specify vector type, colors, data fields, SQL queries, label size and justification, etc.

By default d.vect fills in holes in polygons (islands). If you only want to show active areas limit the features with, e.g.,

d.vect map=vector_map cats=1-999999

In order to display attributes in the map, display=attr must be specified in addition to the column name (attrcol parameter).

Colors may be specified in an attribute table column named 'GRASSRGB' (which is a varchar(11) column containing RRR:GGG:BBB values), see the flag -a.

A table for a vector map might look like this: sql="select * from testisola"
0|no data|255:255:255
139|PERGINE VALSUGANA|223:45:237

To add the GRASSRGB color column, use v.db.addcol:

v.db.addcol map=testisola columns="GRASSRGB varchar(11)"

To add/change a color, use v.db.update:

v.db.update map=testisola column=GRASSRGB value="123:45:237" where="cat=139"

A much simpler method of color coding is by using the -c flag which displays vector elements of like category number with a random color.

This module can use FreeType/TrueType fonts if they have already been selected with d.font.

Parameter width is set by default to '0'. XDRIVER specifies the precise behaviour for non-zero line width, but drivers have some freedom as to how zero-width lines are handled, so they can use the hardware's "thin line" drawing primitive, if it has one. A width of zero can potentially result in significantly faster operation. On drivers where there is no such thing as a "thin" line, the driver will use a sensible default (which might not be the same as '1').


Spearfish examples:
# display roads with category numbers:
d.vect map=roads display=shape,cat lcolor=green

# display randomly colorized soils map with attributes
d.vect -c map=soils display=attr attrcol=label

# display randomly colorized selected vectors from soils map
d.vect -c map=soils where="label='VBF'" display=shape,attr attrcol=label

3D points, 3D lines and 3D polygons colorized according to z height:

g.region rast=elevation.10m
r.random input=elevation.10m n=5000 vector=random3d -d
d.mon start=x0
# display as black points
d.vect map=random3d
# display 3D points colorized according to z height
d.vect -z map=random3d zcolor=gyr

# 3D contour lines
r.contour input=elevation.10m output=contour20m step=20
d.vect -z map=contour20m zcolor=gyr

# generate 3D triangles
v.delaunay input=random3d output=random3d_del
# display 3D polygons colorized according to z height
d.vect -z map=random3d_del type=area zcolor=gyr


d.erase, d.what.vect, d.rast, d.font.freetype, v.colors, v.db.addcol, v.db.update
GRASS SQL interface


Radim Blazek, ITC-Irst, Trento, Italy
other GRASS developers

Last changed: $Date$