v.to.3d(1)

✨ v.to.3d ✨

okay bestie, welcome to the GRASS GIS User's Manual page for v.to.3d(1) β€” the lil glow-up module that takes your flat 2D vector features and gives them a whole third dimension πŸ¦‹ no cap, it's giving main character energy.


🌸 NAME 🌸

v.to.3d β€” performs transformation of 2D vector features to 3D. literally the makeover episode of vector geometry πŸ’…

🏷️ KEYWORDS 🏷️

vector, geometry, 3D ✨

πŸ“œ SYNOPSIS πŸ“œ

v.to.3d
v.to.3d --help
v.to.3d [-rt] input=name  [layer=string]   [type=string[,string,...]]
output=name  [column=name]   [height=float]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags πŸŽ€

  • -r β€” reverse transformation; 3D vector features to 2D. yes queen, it can go both ways πŸ”„
  • -t β€” do not copy attribute table. keep it minimal, we love a clean slate βœ‚οΈ
  • --overwrite β€” allow output files to overwrite existing files. chaos mode enabled, use responsibly πŸ’€
  • --help β€” print usage summary
  • --verbose β€” verbose module output. spill the tea β˜•
  • --quiet β€” quiet module output 🀫
  • --ui β€” force launching GUI dialog. for the visual girlies πŸ–₯️

🌈 Parameters 🌈

  • input=name [required] β€” name of input vector map. or, plot twist, data source for direct OGR access πŸ‘€
  • layer=string β€” layer number or name (-1 for all layers). a single vector map can be connected to multiple database tables. this number determines which table to use. when used with direct OGR access this is the layer name. default: 1 🫢
  • type=string[,string,...] β€” input feature type. options: point, line, boundary, centroid. default: point,line,boundary,centroid πŸ’–
  • output=name [required] β€” name for output vector map 🌟
  • column=name β€” name of attribute column used for height. can be used for reverse transformation, to store height of points πŸ“
  • height=float β€” fixed height for 3D vector features. one number, all the vibes πŸ“

πŸ’œ DESCRIPTION πŸ’œ

okay so the v.to.3d module is the tool for transforming 2D vector features into 3D. the height (that's the z-coordinate, bestie) of your 3D vector features can be specified either by the height parameter as a fixed value, or by the column parameter. pick your fighter ✨

and then there's flag -r, which flips the whole thing: it enables you to perform the reverse transformation, i.e., transform 3D vector to 2D by omitting the z-coordinate. the height of the input 3D features can optionally be stored in column. so you're not losing the info, you're just... relocating it 😌

πŸ“ NOTES πŸ“

when transforming 2D vector features to 3D based on attribute, all NULL values are silently converted to height 0.0. no warning, no drama, just zero. just so you know, fr fr 😭

reverse transformation is possible for points and lines. but listen β€” in the case of lines, the reverse transformation should be used only when all vertices of a line have the same z-coordinate (for example contours). otherwise it's giving undefined nonsense and we don't do that πŸ’€


πŸ§ͺ EXAMPLES πŸ§ͺ

✨ Transform 2D vector features to 3D ✨

# convert z-values from string to double
v.db.addcolumn map=geodetic_pts columns="Z_VALUE_D double precision"
v.db.update map=geodetic_pts column=Z_VALUE_D qcolumn=Z_VALUE
v.db.select map=geodetic_pts columns=cat,Z_VALUE,Z_VALUE_D
# convert 2D vector point map to 3D based on attribute
v.to.3d input=geodetic_pts out=geodetic_pts_3d column=Z_VALUE_D

look at that glow-up, we love a data-type transformation arc πŸ¦‹

πŸŽ€ Transform 3D vector features to 2D πŸŽ€

v.to.3d -rt input=elev_lid792_bepts output=elev_lid_2d

and just like that, we're flat again. iconic ✨


πŸ‘€ SEE ALSO πŸ‘€

v.transform, v.extrude, v.drape

πŸ‘‘ AUTHOR πŸ‘‘

Martin Landa, Czech Technical University in Prague, Czech Republic πŸ’–

πŸ”— SOURCE CODE πŸ”—

available at: v.to.3d source code (history) 🌈

accessed: Saturday Jan 17 05:41:31 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 🫢

and that's the whole page bestie β€” this was v.to.3d(1) from GRASS 8.4.2, signed, sealed, and delivered with all the love in the world. go forth and add that z-coordinate πŸ’…βœ¨

πŸ“¦ where this page comes from