v.what.rast3(1grass)
π v.what.rast3 β the GRASS User's Manual glow-up π
okay bestie, sit DOWN, because this is the module that takes 3D raster values and yeets them into your vector attribute table at exactly the right point positions. it's v.what.rast3, from the GRASS User's Manual, and she is lowkey iconic. π¦
β¨ NAME β¨
v.what.rast3 β uploads 3D raster values at positions of vector points to the table. that's the whole job. she samples, she writes, she goes home. π
π KEYWORDS π
<vector>vector</vector>, sampling, raster, position, querying, attribute table, surface information
(aka all the search terms you'd type at 2am trying to find her again π«Ά)
πΈ SYNOPSIS πΈ
the way she wants to be called:
v.what.rast3
v.what.rast3 --help
v.what.rast3 map=name [layer=string] raster_3d=name column=name
[where=sql_query] [--help] [--verbose] [--quiet] [--ui]
π Flags
--helpβ print the usage summary. your lil "wait what does this do again" button. π--verboseβ verbose module output. she tells you EVERYTHING. not me loving the yapping π£οΈ--quietβ quiet module output. shhh. she's in her silent era. π€«--uiβ force launching the GUI dialog. for when clicking > typing. π
π§ Parameters
map=name[required] β name of the vector points map you wanna edit attributes for. or, plot twist, a data source for direct OGR access. πlayer=stringβ layer number or name. vector features can have category values in different layers, and this number decides which layer we're on. when you're using direct OGR access, this is the layer name instead. default?1, obviously. βraster_3d=name[required] β name of an existing 3D raster map to be queried. the source of truth. the main character. πcolumn=name[required] β name of the attribute column that gets updated with the query result. the glow-up destination. β¨where=sql_queryβ WHERE conditions of an SQL statement, written without thewherekeyword, bestie, don't add it. example:income < 1000 and population >= 10000. π
π DESCRIPTION π
okay so v.what.rast3 reads the 3D raster value for each point in your vector, and then updates the col column in the vector attribute table with that value. no cap.
the column should be type double. don't fight her on this.
this module is based on v.what.rast β so if you know her, you know this one's vibe. πΈ
and now the important bits, listen up:
if more points have the same category, the attribute value is set to NULL. fr fr, that's what happens.
if the 3D raster value isNULL, the attribute value is set toNULL. yes, really. NULL in, NULL out. π
π¦ NOTES π¦
silence π
(this section is empty in the original, and honestly? leaving space for the mystery. she said nothing and understood everything. π)
π₯ EXAMPLES π₯
A) π« the classic
reading values from a 3D raster map at the position of vector points, and writing those values into a column of the attribute table connected to the vector map:
v.what.rast3 map=pnts raster3d=plume column=concentration
B) π the build-it-from-scratch
in case of a vector map without an attached attribute table, first add a new attribute table. this table is then populated with values queried from the raster map:
# create new random 3d vector points map
v.random -z output=pnts npoints=100 zmin=0 zmax=50
# add new table, link to map
v.db.addtable map=pnts column="concentration double precision"
# query raster map and upload values to vector table into specified column
g.region raster3d=plume -p
v.what.rast3 map=pnts raster3d=plume column=concentration
# verify new attribute table:
v.db.select map=pnts
# verify statistics of uploaded values:
v.univar map=pnts column=concentration type=point
and that's the whole pipeline, bestie. create, link, query, upload, verify, verify again. she ate and left no crumbs. ππ«Ά
okay tiny heads-up: that second example literally writesraster3d=plume, notraster_3d=plume. we're keeping it exactly as the page has it, char for char, no editing the queen. π
π SEE ALSO π
go check out her friends, they're all so valid:
v.db.addtablev.db.selectv.what.rastv.what.vectv.univar
π AUTHOR π
Soeren Gebbert, heavily based on v.what.rast by Radim Blazek.
shoutout to the two of them, absolute legends, standing on each other's shoulders like the iconique collab it is. π
π SOURCE CODE π
available at: v.what.rast3 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
and that's the page, bestie β she's v.what.rast3(1grass), she ships with GRASS 8.5.0, and she's copyrighted Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual. periodt. now go sample some 3D rasters, you gorgeous genius. πβ¨π¦
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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