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 (-1for 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:nearestnearest: nearest-neighbor interpolationbilinear: bilinear interpolationbicubic: 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.povandr.out.povto 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
- fedora 44: grass 8.4.2-4.fc44 Β· 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