GRASS logo

Note: A new GRASS GIS stable version has been released: GRASS GIS 7. Go directly to the new manual page here

NAME - Converts (rasterize) a vector map into a raster map.


vector, raster, conversion

SYNOPSIS help input=name [layer=integer] [type=string[,string,...]] output=name use=string [column=name] [rgbcolumn=name] [labelcolumn=name] [value=float] [rows=integer] [--overwrite] [--verbose] [--quiet]


Allow output files to overwrite existing files
Verbose module output
Quiet module output


Name of input vector map
Layer number
A single vector map can be connected to multiple database tables. This number determines which table to use.
Default: 1
Feature type
Options: point,line,area
Default: point,line,area
Name for output raster map
Source of raster values
Options: attr,cat,val,z,dir
Default: attr
attr: read values from attribute table
cat: use category values
val: use value specified by value option
z: use z coordinate (points or contours only)
dir: output as flow direction (lines only)
Name of column for 'attr' parameter (data type must be numeric)
Name of color definition column (with RRR:GGG:BBB entries)
Name of column used as raster category labels
Raster value (for use=val)
Default: 1
Number of rows to hold in memory
Default: 4096

DESCRIPTION transforms GRASS vector map layers into GRASS raster map layer format. Optionally, attributes can be converted into raster category labels.

NOTES will only affect data in areas lying inside the boundaries of the current geographic region. Before running, the user should therefore ensure that the current geographic region is correctly set and that the region resolution is at the desired level.

Either the column parameter or the value parameter must be specified. The use option may be specified alone when using the dir option.

use options are:

The column parameter uses an existing column from the vector map database table as the category value in the output raster map. Existing table columns can be shown by using db.describe.

An empty raster map layer will be created if the vector map layer has not been assigned category/attribute labels (e.g., through use of v.category option=add).


Flow directions are given in degrees counterclockwise from east.

Raster category labels are supported for all of use= except use=z.


1. Convert a vector map and use column SPEED from attribute table
db.describe -c table=vect_map

Column 1: CAT
Column 2: SPEED
Column 3: WIDTH in=vect_map out=raster_map col=SPEED

2. Calculate stream directions from a river vector map (Spearfish) in=streams out=streamsdir use=dir

3. Convert a vector polygon map to raster including descriptive labels (Spearfish) in=fields out=myfields use=attr col=cat labelcol=label
r.category myfields


db.describe, v.category


Original code: Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
GRASS 6.0 updates: Radim Blazek, ITC-irst, Trento, Italy
Stream directions: Jaro Hofierka and Helena Mitasova
GRASS 6.3 code cleanup and label support: Brad Douglas

Last changed: $Date: 2011-11-08 03:29:50 -0800 (Tue, 08 Nov 2011) $

Main index - vector index - Full index

© 2003-2016 GRASS Development Team