GRASS logo

NAME

v.to.rast - Converts (rasterize) a vector map into a raster map.

KEYWORDS

vector, conversion, raster, rasterization

SYNOPSIS

v.to.rast
v.to.rast --help
v.to.rast [-d] input=name [layer=string] [type=string[,string,...]] [cats=range] [where=sql_query] output=name use=string [attribute_column=name] [rgb_column=name] [label_column=name] [value=float] [memory=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-d
Create densified lines (default: thin lines)
All cells touched by the line will be set, not only those on the render path
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

input=name [required]
Name of input vector map
Or data source for direct OGR access
layer=string
Layer number or name
Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.
Default: 1
type=string[,string,...]
Input feature type
Options: point, line, area
Default: point,line,area
cats=range
Category values
Example: 1,3,7-9,13
where=sql_query
WHERE conditions of SQL statement without 'where' keyword
Example: income < 1000 and inhab >= 10000
output=name [required]
Name for output raster map
use=string [required]
Source of raster values
Options: attr, cat, val, z, dir
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)
attribute_column=name
Name of column for 'attr' parameter (data type must be numeric)
rgb_column=name
Name of color definition column (with RRR:GGG:BBB entries)
label_column=name
Name of column used as raster category labels
value=float
Raster value (for use=val)
Default: 1
memory=integer
Maximum memory to be used (in MB)
Cache size for raster rows
Default: 300

Table of contents

DESCRIPTION

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

NOTES

v.to.rast will only affect data in areas lying inside the boundaries of the current geographic region. Before running v.to.rast, 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).

Otherwise:

Flow directions are given in degrees counterclockwise from east.

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

EXAMPLES

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

ncols:3
Column 1: CAT
Column 2: SPEED
Column 3: WIDTH 
v.to.rast in=vect_map out=raster_map col=SPEED

2. Calculate stream directions from a river vector map (Spearfish)

v.to.rast in=streams out=streamsdir use=dir

3. Convert a vector polygon map to raster including descriptive labels (Spearfish)

v.to.rast in=fields out=myfields use=attr col=cat labelcol=label
r.category myfields

SEE ALSO

db.describe, v.category

AUTHORS

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 13:24:20 -0800 (Tue, 08 Nov 2011) $


Main index | Vector index | Topics index | Keywords index | Full index

© 2003-2015 GRASS Development Team, GRASS GIS 7.0.0 Reference Manual