v.out.vtk(1)

πŸ’– v.out.vtk β€” the GRASS GIS bestie that turns your vector map into VTK ASCII πŸ’–

okay so real talk, this is v.out.vtk(1) from the GRASS GIS User's Manual, and she is that girl. she takes your vector map and serves it up as VTK ASCII output. no cap. πŸ¦‹


✨ NAME ✨

v.out.vtk β€” converts a vector map to VTK ASCII output. periodt. πŸ’…

πŸŽ€ KEYWORDS πŸŽ€

vector, export, output, VTK β€” yes bestie, all of them. iykyk. ⭐

🌸 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 (the little switches that change everything)

  • -c β€” Correct the coordinates to fit the VTK-OpenGL precision. (more on why she's important later, she's lowkey a lifesaver 😭)
  • -n β€” Export numeric attribute table fields as VTK scalar variables. numbers as scalars, slay ✨
  • --overwrite β€” Allow output files to overwrite existing files. she will simply replace what's there, no hesitation πŸ’€
  • --help β€” Print usage summary.
  • --verbose β€” Verbose module output. she'll tell you everything. main character energy fr.
  • --quiet β€” Quiet module output. she says nothing. mysterious. iconic.
  • --ui β€” Force launching GUI dialog. pop-up era 🌈

πŸ’œ Parameters (the actual info you gotta hand over)

  • input=name [required] β€” Name of input vector map. Or data source for direct OGR access. yes babe it's required, she needs the goods πŸ“
  • 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: 1.
  • output=name β€” Name for output VTK file.
  • type=string[,string,...] β€” Input feature type. Options: point, kernel, centroid, line, boundary, area, face. Default: point,kernel,centroid,line,boundary,area,face (yes she defaults to everything, she's generous like that πŸ’–).
  • precision=integer β€” Number of significant digits.
  • zscale=float β€” Scale factor for elevation. Default: 1.0.

🌈 DESCRIPTION 🌈

v.out.vtk converts a GRASS vector map in binary format to the VTK ASCII output. that's the whole job bestie and she does it flawlessly.

If the output parameter is not given, the output will be send to stdout. so if you don't tell her where to put it, she just yells it into the terminal. valid. 😌


πŸ‘‘ NOTES πŸ‘‘

The following vector types can be exported together in one VTK ascii file:

  • point
  • line
  • centroid
  • boundary
  • area
  • face

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, as normal cat's are always positive. If a vector has more categories in one layer, only the first category will be exported. one cat only, she's monogamous to the first one 🐱

3d vectors are supported by default. The created VTK data always includes x, y and z coordinates (z = 0 if not a 3d vector map). Note that you can easily convert your 2d vectors into 3d vectors with v.drape. glow up your flat little vectors, they deserve it ✨

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). she's literally just shrinking the numbers so OpenGL doesn't have a meltdown πŸ’€

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). consistency is key, bestie, do NOT mix and match here πŸ™ˆ

The GRASS vector data is converted into the polydata format of VTK:

  • vtk Vertices β€” representing points and centroids
  • vtk lines β€” representing lines and boundaries
  • vtk polygons β€” representing areas and faces

The VTK file can be visualized with VTK Toolkit, Paraview and MayaVi. take your pick, she's compatible with all her girls πŸ’…

⚠️ Attention ⚠️

If areas or faces are exported, the data have to be triangulated within Paraview or MayaVi. not optional, bestie, do not skip this step or it's giving broken render 😭


🧚 EXAMPLE 🧚

Spearfish example, aka the classic:

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

go check them out, they're her siblings and they all ate πŸ’–


⭐ AUTHOR ⭐

Soeren Gebbert β€” thank you king, we appreciate you 🫢


πŸ’– SOURCE CODE πŸ’–

Available at: v.out.vtk source code (history)

Accessed: Saturday Jan 17 05:41:28 2026

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

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


okay that's the whole page bestie!! this manual is from GRASS 8.4.2 (the footer said so, and honestly she's thriving), the accessed date was Saturday Jan 17 05:41:28 2026, it's all under the Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual umbrella, and the footer on the original literally just read GRASS 8.4.2 next to v.out.vtk(1). so yeah β€” go export something gorgeous, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from