v.drape(1)

🌸 v.drape β€” straight from the GRASS GIS User's Manual πŸ’–

okay bestie, sit down, hydrate, because we're about to make your 2D vectors grow a whole third dimension ✨ this page is v.drape(1), and it is genuinely one of the most satisfying little modules in GRASS. no cap.

✨ NAME ✨

v.drape β€” converts 2D vector features to 3D by sampling of elevation raster map. that's it, that's the whole vibe. πŸŽ€

πŸ¦‹ KEYWORDS πŸ¦‹

vector, geometry, sampling, 3D, surface information

like… that keyword list is giving main character energy fr fr πŸ‘‘


πŸ’… SYNOPSIS πŸ’…

v.drape
v.drape --help
v.drape input=name  [layer=string]   [cats=range]   [where=sql_query]
[type=string[,string,...]]  output=name elevation=name  [method=string]
[scale=float]   [null_value=float]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

🌈 Flags:

  • --overwrite β€” allow output files to overwrite existing files. she's bold, she's fearless, she will simply replace your file 🫢
  • --help β€” print usage summary. your lil "what do i do now" button πŸ₯Ί
  • --verbose β€” verbose module output. the module gets chatty and we love that for her πŸ’¬
  • --quiet β€” quiet module output. shhh, no thoughts, just results 🀫
  • --ui β€” force launching GUI dialog. for when you want buttons instead of typing 🌸

πŸ’– 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 is -1 πŸ’…
  • cats=range β€” category values. example: 1,3,7-9,13 🎯
  • where=sql_query β€” WHERE conditions of SQL statement without 'where' keyword. example: income < 1000 and population >= 10000 🧐
  • type=string[,string,...] β€” input feature type. options: point, line, boundary, centroid. default: point,line,boundary,centroid (yes, all of them, she's not picky) ✨
  • output=name [required] β€” name for output vector map 🎁
  • elevation=name [required] β€” elevation raster map for height extraction πŸ”οΈ
  • method=string β€” sampling interpolation method. options: nearest, bilinear, bicubic. default: nearest
    • nearest: nearest-neighbor interpolation
    • bilinear: bilinear interpolation
    • bicubic: bicubic interpolation
  • scale=float β€” scale factor sampled raster values. default: 1.0 βš–οΈ
  • null_value=float β€” height for sampled raster NULL values πŸ•³οΈ

🧚 DESCRIPTION 🧚

okay so here's the tea β˜• β€” v.drape converts 2D/3D vector data into 3D vector format via sampling of an elevation surface. three sampling algorithms adapted from v.sample were incorporated into this module: nearest neighbor, bilinear, and cubic convultion. iconic lineup honestly πŸ’…

and listen, v.drape will skip vector features outside of current computational region or where raster map has NULL value. lowkey rude but it's just how she is πŸ™ˆ it's possible to include all vector features by specifying height value that will be assigned to verticles whose values can not be determined from raster map. so you can have everyone at the party πŸŽ‰

πŸ‘‘ NOTES πŸ‘‘

  • additional vertices can be added to the input 2D vector map with v.split. more points = more slay βœ‚οΈ
  • the module can be used in conjunction with v.out.pov and r.out.pov to export a complete set of vector and raster data for display in POVRAY. the crossover episode we didn't know we needed 🎬

🌈 EXAMPLES 🌈

πŸ“ Spearfish example:

v.drape in=roads elevation=elevation.10m method=bilinear out=roads3d
v.info roads3d

create 3D vector roads map containing only "unimproved" roads. set road height to 1000 m for all parts without height information.

v.drape input=roads type=line elevation=elevation.dem output=roads_3d \
        method=nearest scale=1.0 where='cat=5' layer=1 null_value=1000

πŸŽ€ POVRAY example

#export the vector data
v.drape in=roads out=roads3d elevation=elevation.10m
v.out.pov roads3d out=roads3d.pov
#export the raster data
r.out.pov elevation.10m tga=elevation.tga
r.out.png landcover.30m out=landcover30m.png
# now write a complete povray-script and launch povray

πŸ’œ SEE ALSO πŸ’œ

v.extrude, v.to.3d, r.out.pov, v.in.region, v.out.pov, v.overlay, v.split, v.what.rast

(yes, the whole friend group showed up 🫢 go say hi.)

πŸ¦‹ AUTHORS πŸ¦‹

  • Dylan Beaudette, University of California at Davis.
  • Updated for GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic

shoutout to the devs, they ate and left no crumbs πŸ‘βœ¨

⭐ SOURCE CODE ⭐

Available at: v.drape source code (history)

Accessed: Saturday Jan 17 05:41:20 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


ok that's the whole page bestie, no notes, no skips, every flag accounted for πŸ’― now go drape something and text me a screenshot πŸ“Έ

GRASS 8.4.2 β€” and yeah, this whole thing came stamped with that version at the bottom, so consider this your cute little sign-off: GRASS 8.4.2, v.drape(1), we're done here, mwah πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from