v.drape(1grass)

πŸ’– v.drape β€” the GRASS User's Manual glow-up πŸ’–

okay bestie, sit down, hydrate, because v.drape is literally the glow-up artist of the vector world. It takes your flat little 2D vector features and gives them height, dimension, main character energy. No cap.

🌸 KEYWORDS 🌸

vector, geometry, sampling, 3D, surface information


✨ 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 β€” let your output files just bulldoze over whatever's already there. yes, existing files, move over, she's arriving πŸ’…
  • --help β€” prints the usage summary, aka the "help me I'm baby" button.
  • --verbose β€” verbose module output, she will not stop talking and honestly? we love that for her.
  • --quiet β€” quiet module output. the opposite vibe. silence, but make it chic.
  • --ui β€” forces the GUI dialog to launch. clicky-clicky mode activated πŸ–±οΈβœ¨

πŸ¦‹ Parameters πŸ¦‹

  • input=name [required] β€” name of the input vector map. Or, plot twist, a 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, and this number is the one that decides which table gets used. When you're doing direct OGR access, this is the layer name instead. Default: -1
  • cats=range β€” category values. Example: 1,3,7-9,13
  • where=sql_query β€” WHERE conditions of an SQL statement, without the where keyword itself. Example: income < 1000 and population >= 10000
  • type=string[,string,...] β€” input feature type. Options: point, line, boundary, centroid. Default: point,line,boundary,centroid
  • output=name [required] β€” name for the output vector map. your little 3D baby, born today 🫢
  • elevation=name [required] β€” the elevation raster map that height extraction pulls from. this is the source of all the verticality, the drama, the altitude.
  • 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. i.e. what to do when the raster simply refuses to give you a number 😭

πŸ‘‘ DESCRIPTION πŸ‘‘

v.drape converts 2D/3D vector data into 3D vector format by sampling an elevation surface. It's giving makeover montage. Three sampling algorithms adapted from v.sample got folded into this module: nearest neighbor, bilinear, and cubic convultion.

v.drape will skip vector features that sit outside the current computational region, or where the raster map has a NULL value. But β€” and this is the plot twist β€” it's possible to include all vector features by specifying a height value that will be assigned to those verticles whose values can't be determined from the raster map. so nobody gets left on read πŸ’–

πŸ”₯ NOTES πŸ”₯

Additional vertices can be added to the input 2D vector map with v.split.

The module can also 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. collaboration era ✨


🌈 EXAMPLES 🌈

Spearfish example:

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

Create a 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

🌟 AUTHORS 🌟

Dylan Beaudette, University of California at Davis.

Updated for GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic.

πŸ“œ SOURCE CODE πŸ“œ

Available at: v.drape source code (history)

Latest change: Friday Feb 07 19:16:09 2025 in commit: a82a39f673b97fafcfce1604dc3e6015cb96487a

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


okay that's the whole page bestie, every flag, every default, every little detail, untouched and accounted for. iykyk 🫢✨

and the cute lil sign-off: this is from the GRASS 8.5.0 Reference Manual, Β© 2003-2026 GRASS Development Team, and the man page tag is GRASS 8.5.0 / v.drape(1grass). mwah πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from