r.out.vtk(1)

NAME
r.out.vtk - Converts raster maps into the VTK-Ascii format

KEYWORDS
raster

SYNOPSIS
r.out.vtk
r.out.vtk help
r.out.vtk [-stvopc] [input=string[,string,...]] [elevation=string] [rgbmaps=string[,string,...]] [vectormaps=string[,string,...]] [output=string] [null=float] [elevscale=float] [elevation2d=float]

  Flags:

-s  Use structured grid for elevation (not recommended)

-t  Use polydata-trianglestrips for elevation grid creation

-v  Use polydata-vertices for elevation grid creation (to use with vtkDelauny2D)

-o  Scale factor effects the origin (if no elevation map is given)

-p  Create VTK point data instead of VTK cell data (if no elevation map is given)

-c  Correct the coordinates to fit the VTK-OpenGL precision

  Parameters:

input=string[,string,...]
    Raster map(s) to be converted to VTK-ASCII data format

elevation=string
    Raster map that represents the elevation, used for the 3D information

rgbmaps=string[,string,...]
    Three (r,g,b) raster maps which are used to create rgb values [redmap,greenmap,bluemap]

vectormaps=string[,string,...]
    Three (x,y,z) raster maps which are used to create vector values [xmap,ymap,zmap]

output=string
    Name for VTK-ASCII output file

null=float
    Value to represent no data cell Default: -10.0

elevscale=float
    Scale factor for elevation Default: 1.0

elevation2d=float
    Elevation (if no elevation map is given) Default: 0.0

DESCRIPTION
Outputs Raster maps in VTK-ASCII format. Map's are valid Raster map's in the current mapset. output is the name of an VTK-ASCII file which will be written in the current working directory. If output is not specified then stdout is used. The module is sensitive to region settings (set with g.region).
Elevation, scaling, point/celldata, vector and RGB Data are supported.
If no elevation map is given, the user can set the hight of the map by one value. Point or cell data are available. Also scaling is supported for this elevation value.
The RGB input requires three raster maps: red, green, blue - in this order. The maps must have values between 0 and 255, otherwise you will get lots of warnings and the values are set to 0. More than one RGB dataset (3 maps) is not supported.
The vector input requires three raster maps: x, y, z -- defining the vector coordinates - in this 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 puts this in a simple VTK-ASCII file. Nor XML or binary output are supported. It is 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 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 choosen null value in the VTK-ASCII file.
If elevation map is choosen, a polygonal grid is created with quads, but the user can choose also triangle strips or vertices. These dataformats a 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 default region).

  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 hight 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 a nice region
g.region -d
g.region n=4926970 s=4914857 w=591583 e=607793 res=50
#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 -d
g.region n=4926970 s=4914857 w=591583 e=607793 res=50
#we are using r.in.onearth (available from the grass addon wiki) to create rgb data
#get some satellite images with r.in.onearth
r.in.onearth -l output=Sat tmband=Red
r.in.onearth -l output=Sat tmband=IR1
r.in.onearth -l output=Sat tmband=IR2
#export the data
r.out.vtk rgbmaps=SatLandsatTM_IR1,SatLandsatTM_IR2,SatLandsatTM_Red elevation=elevation.10m output=/tmp/out.vtk
# visualize in paraview or other VTK viewer:
paraview --data=/tmp/out.vtk

SEE ALSO
r3.out.vtk
r.out.ascii
g.region

AUTHORS
Soeren Gebbert

Last changed: $Date: 2006/06/16 19:35:13 $

Full index