r.out.vtk(1)
r.out.vtk π
okay bestie, welcome to the GRASS GIS User's Manual page for r.out.vtk β the lil module that turns your raster maps into VTK-ASCII so you can go absolutely feral in Paraview. let's get into it π¦
β¨ NAME β¨
r.out.vtk β converts raster maps into the VTK-ASCII format. that's it, that's the whole job, and it eats every time π
πΈ KEYWORDS πΈ
raster, export, output, VTK
π SYNOPSIS π
r.out.vtk
r.out.vtk --help
r.out.vtk [-pstvoc] [input=name[,name,...]] [output=name]
[elevation=name] [null=float] [z=float]
[rgbmaps=string[,string,...]] [vectormaps=string[,string,...]]
[zscale=float] [precision=integer] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
Flags π©
-pβ make VTK point data instead of VTK cell data (only if you're not giving it an elevation map, iykyk)-sβ use a structured grid for elevation (ngl, not recommended π)-tβ use polydata-trianglestrips for elevation grid creation-vβ use polydata-vertices for elevation grid creation (this is the one you pair withvtkDelauny2D)-oβ the scale factor also affects the origin (again: only when there's no elevation map)-cβ correct the coordinates to match the VTK-OpenGL precision β¨--overwriteβ allow output files to overwrite existing files (chaotic, but go off)--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output--uiβ force launching GUI dialog
Parameters π§
input=name[,name,...]β raster map(s) to be converted to VTK-ASCII data formatoutput=nameβ name for the VTK-ASCII output fileelevation=nameβ name of input elevation raster mapnull=floatβ value to represent a no-data cell. Default:-99999.99z=floatβ constant elevation (when no elevation map is specified). Default:0.0rgbmaps=string[,string,...]β three (r,g,b) raster maps to create RGB values, as[redmap,greenmap,bluemap]vectormaps=string[,string,...]β three (x,y,z) raster maps to create vector values, as[xmap,ymap,zmap]zscale=floatβ scale factor for elevation. Default:1.0precision=integerβ number of significant digits (floating point only). Options:0-20. Default:12
π DESCRIPTION π
so it outputs raster maps in VTK-ASCII format. the maps have to be valid raster maps in the current mapset, no exceptions bestie. output is the name of the VTK-ASCII file it writes, and it lands in the current working directory. if you don't specify output, then stdout gets used instead. this module is sensitive to region settings β set with g.region, periodt.
Elevation, scaling, point/celldata, vector and RGB data are all supported π. if the map is in LL projection, the elevation values get automatically scaled to degrees. it's assumed the elevation values come in meters. if your elevation values are in some other unit than meters, use the scale parameter to convert the units.
if no elevation map is given, you can set the height of the map with one single value. point data or cell data, your choice. scaling is supported for that elevation value too. and the elevation value must be provided in meters π.
the RGB input needs three raster maps: red, green, blue β in that order. the maps must have values between 0 and 255, otherwise you'll get lots of warnings and the values get set to 0 π. more than one RGB dataset (3 maps) is not supported.
the vector input needs three raster maps: x, y, z β defining the vector coordinates β in that order. more than one vector dataset (3 maps) is not supported.
π NOTES π
this filter generates:
- structured points with celldata or pointdata if no elevationfile is given
- structured grid (not recommendet) with pointdata if an elevationfile is given
- polydataset with pointdata if an elevationfile is given (default)
and it puts this all in a simple VTK-ASCII file. Nor XML or binary output are supported (fr fr, don't ask). it's possible to choose more then one raster map to be written to the VTK-ASCII file. each cell-/pointdata is named like the raster map it represents π. you can visualize this file with the VTK Toolkit, Paraview and MayaVi, which are all based on VTK. if you have a raster map with partly no data, use the threshold filter in paraview to visualize the valid data β just filter all data which is greater/lesser than the chosen null value in the VTK-ASCII file π .
if an elevation map is chosen, a polygonal grid is created with quads, but you can also choose triangle strips or vertices. these dataformats are documented at VTK Toolkit.
if the -c flag is used and the data should be visualised together with other data exported via *.out.vtk modules, be sure the -c flag was also set in these modules. but this will only work with data from the SAME location (the reference point for the coordinates transformation is based on the center point of the default region). don't say I didn't warn you π«Ά
Difference between point- and celldata π
r.out.vtk can export raster cells with different representations.
- pointdata β the cells/values are represented by the center of the cell. Instead of cells, points are created. Each point can hold different values, but the user can only visualize one value at a time. These points can be connected in different ways.
- celldata β is only provided if no elevation map is given. The cells are created with the same height and width as in GRASS. Each cell can hold different values, but the user can only visualize one value at a time.
β EXAMPLE β
Simple Spearfish example π
# set region
g.region n=4926970 s=4914857 w=591583 e=607793 res=50 -p
# export the data
r.out.vtk input=elevation.10m,slope,aspect elevation=elevation.10m output=/tmp/out.vtk
# visualize in Paraview or other VTK viewer:
paraview --data=/tmp/out.vtk
Spearfish example with RGB data π¨
#set the region
g.region n=4926990 s=4914840 w=591570 e=607800 res=30 -p
# using r.in.wms to create RGB data to get a satellite coverage
r.in.wms layers=global_mosaic mapserver=http://wms.jpl.nasa.gov/wms.cgi \
output=wms_global_mosaic
# export the data to VTK
r.out.vtk rgbmaps=wms_global_mosaic.red,wms_global_mosaic.green,wms_global_mosaic.blue \
elevation=elevation.10m output=/tmp/out.vtk
# visualize in Paraview or other VTK viewer:
paraview --data=/tmp/out.vtk
Paraview RGB visualization notes
to achieve proper RGB overlay:
- In Paraview, click "Apply"
- Select the "Display" tab and choose "Color by" to switch from input scalars to rgb scalars
- Disable the "Map Scalars" check button in the display tab to avoid the use of a lookup table
π¦ SEE ALSO π¦
r3.out.vtk,r.out.ascii,g.region- GRASS and Paraview Wiki page
π AUTHOR π
Soeren Gebbert
π SOURCE CODE π
Available at: r.out.vtk source code (history)
Accessed: Saturday Jan 17 05:40:53 2026
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page bestie, you ate that π«Ά ok so the cute lil sign-off: this is from the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, and the source/version footer was GRASS 8.4.2 with r.out.vtk(1). slay, go export some rasters β¨πΈπ
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms