Rasterize a vector dataset.
This application allows to reproject and rasterize a vector dataset. The grid of the rasterized output can be
set by using a reference image, or by setting all parmeters (origin, size, spacing) by hand. In the latter
case, at least the spacing (ground sampling distance) is needed (other parameters are computed
automatically). The rasterized output can also be in a different projection reference system than the input
dataset.
There are two rasterize mode available in the application. The first is the binary mode: it allows to
render all pixels belonging to a geometry of the input dataset in the foreground color, while
rendering the other in background color. The second one allows to render pixels belonging to
a geometry woth respect to an attribute of this geometry. The field of the attribute to render
can be set by the user. In the second mode, the background value is still used for unassociated
pixels.
This section describes in details the parameters available for this application. Table 4.30, page 457 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is Rasterization.
Parameter key | Parameter type |
Parameter description |
in | Input vector data |
Input vector dataset |
out | Output image |
Ouptut image |
im | Input image |
Input reference image |
szx | Int |
Output size x |
szy | Int |
Output size y |
epsg | Int |
Output EPSG code |
orx | Float |
Output Upper-left x |
ory | Float |
Output Upper-left y |
spx | Float |
Spacing (GSD) x |
spy | Float |
Spacing (GSD) y |
background | Float |
Background value |
mode | Choices |
Rasterization mode |
mode binary | Choice |
Binary mode |
mode attribute | Choice |
Attribute burning mode |
mode.binary.foreground | Float |
Foreground value |
mode.attribute.field | String |
The attribute field to burn |
ram | Int |
Available RAM (Mb) |
inxml | XML input parameters file |
Load otb application from xml file |
outxml | XML output parameters file |
Save otb application to xml file |
|
||
|
||
|
||
|
||
|
Input vector dataset The input vector dataset to be rasterized
Ouptut image An output image containing the rasterized vector dataset
Input reference image A reference image from which to import output grid and projection reference system information.
Output size x Output size along x axis (useless if support image is given)
Output size y Output size along y axis (useless if support image is given)
Output EPSG code EPSG code for the output projection reference system (EPSG 4326 for WGS84, 32631 for UTM31N...,useless if support image is given)
Output Upper-left x Output upper-left corner x coordinate (useless if support image is given)
Output Upper-left y Output upper-left corner y coordinate (useless if support image is given)
Spacing (GSD) x Spacing (ground sampling distance) along x axis (useless if support image is given)
Spacing (GSD) y Spacing (ground sampling distance) along y axis (useless if support image is given)
Background value Default value for pixels not belonging to any geometry
Rasterization mode Choice of rasterization modes Available choices are:
Available RAM (Mb) Available memory for processing (in MB)
Load otb application from xml file Load otb application from xml file
Save otb application to xml file Save otb application to xml file
To run this example in command-line, use the following:
To run this example from Python, use the following code snippet:
None
This application has been written by OTB-Team.
These additional ressources can be useful for further information: