v.out.vtk(1grass)
π NAME π
okay so bestie, meet v.out.vtk β she's a 1grass manual page girly and her whole thing is: converts a vector map to VTK ASCII output. that's it, that's the job, and she eats every time π
π KEYWORDS π
vector, export, output, VTK
π¦ SYNOPSIS π¦
v.out.vtk
v.out.vtk --help
v.out.vtk [-cn] input=name [layer=string] [output=name]
[type=string[,string,...]] [precision=integer] [zscale=float]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
β¨ Flags β¨
-cβ corrects the coordinates so they actually fit inside VTK-OpenGL precision. the glow-up for your numbers π-nβ exports numeric attribute table fields as VTK scalar variables. slay, numbers in their scalar era β¨--overwriteβ lets output files overwrite existing files (be brave, bestie)--helpβ prints the usage summary--verboseβ verbose module output, i.e. she tells you everything--quietβ quiet module output, i.e. she says nothing at all (mysterious π)--uiβ forces launching the GUI dialog
πΈ Parameters πΈ
input=name[required] β name of input vector map. or, plot twist, a data source for direct OGR access π«Άlayer=stringβ layer number or name. vector features can have category values in different layers, and this number determines which layer to use. when used with direct OGR access this is the layer name. Default:1output=nameβ name for output VTK filetype=string[,string,...]β input feature type. Options:point,kernel,centroid,line,boundary,area,face. Default:point,kernel,centroid,line,boundary,area,faceprecision=integerβ number of significant digitszscale=floatβ scale factor for elevation. Default:1.0
π DESCRIPTION π
v.out.vtk takes a GRASS vector map chilling in binary format and converts it into VTK ASCII output. no cap, that's the whole vibe π€
and here's the tea: if the output parameter is not given, the output will be send to stdout. so if you forget it, she's just gonna start talking into the void (the terminal) and honestly? respect.
π₯ NOTES π₯
the following vector types can be exported together in one VTK ascii file, all cozy in the same file:
pointlinecentroidboundaryareaface
Category data (cat) for the selected vector type and layer will be written as scalar data with name cat_{vectorname}. if no cat exists, the value will set to -1 β because normal cat's are always positive, so -1 is basically the "no thoughts, head empty" sentinel π. and if a vector has more categories in one layer, only the first category will be exported. first come, first served, periodt.
3d vectors are supported by default, bestie. the created VTK data always includes x, y and z coordinates (z = 0 if not a 3d vector map). and psst β you can easily convert your 2d vectors into 3d vectors with v.drape β¨
now for the serious part, don't scroll past this one. because of the 32bit limits of OpenGL which is used by VTK, visualisation errors may occur if the grass region contains coordinates greater than 1.000.000 and vector coordinates with 0.01 - 0.001 meters precisison. for this reason, the flag -c was added. the coordinates are transformed to smaller coordinates (by decreasing the coordinates with the region center). it's giving shrinking yourself so you fit through the door π
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. same location or it doesn't count, iykyk π
the GRASS vector data is converted into the polydata format of VTK:
vtk Verticesβ representing points and centroidsvtk linesβ representing lines and boundariesvtk polygonsβ representing areas and faces
the VTK file can be visualized with VTK Toolkit, Paraview and MayaVi. iconic trio, no notes π
π Attention π
if areas or faces are exported, the data have to be triangulated within Paraview or MayaVi. do not skip this step, she will not do it for you π«Ά
π EXAMPLE π
Spearfish example β a little demo moment for you, bestie:
Export the soils with cats in layer 1:
v.out.vtk input=soils type=area layer=1 output=/tmp/soils.vtk
Export the streams with cats in layer 1:
v.out.vtk input=streams type=line layer=1 output=/tmp/streams.vtk
Write the archsite vtk output to stdout with cats in layer 1:
v.out.vtk input=archsites type=point layer=1
π SEE ALSO π
v.out.ascii, r.out.vtk, r3.out.vtk
π« AUTHOR π«
Soeren Gebbert β thank you for your service, king π
π§ SOURCE CODE π§
Available at: v.out.vtk source code (history)
Latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie π she's v.out.vtk, she lives in the 1grass manual, this is GRASS 8.5.0, the Reference Manual is Β© 2003-2026 GRASS Development Team, and honestly?? obsessed. go export something pretty π
β¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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