r.carve(1grass)
π r.carve β GRASS User's Manual, but make it make sense π
okay bestie, gather round, because r.carve is that girl. It lives in the GRASS User's Manual (aka r.carve(1grass)), and it is here to make your streams actually look like streams. no cap.
β¨ NAME β¨
r.carve β generates stream channels. ποΈ
The way it works: it takes vector stream data, transforms it to raster, and then subtracts depth from the output DEM. literally that's the whole glow-up.
π KEYWORDS π
raster, hydrology
π¦ SYNOPSIS π¦
r.carve
r.carve --help
r.carve [-n] raster=name vector=name output=name [points=name]
[width=float] [depth=float] [--overwrite] [--help] [--verbose]
[--quiet] [--ui]
π© Flags
-nβ no flat areas allowed in flow direction. not a single flat cell, we do not tolerate that energy π--overwriteβ allow output files to overwrite existing files. be brave, bestie, but like... know what you're doing π--helpβ print usage summary--verboseβ verbose module output. it will tell you everything, main character behavior fr fr--quietβ quiet module output--uiβ force launching GUI dialog
πΈ Parameters
raster=name[required] β name of input raster elevation mapvector=name[required] β name of input vector map containing stream(s). Or data source for direct OGR accessoutput=name[required] β name for output raster mappoints=nameβ name for output vector map for adjusted stream pointswidth=floatβ stream width (in meters). Default is raster cell widthdepth=floatβ additional stream depth (in meters)
π DESCRIPTION π
so here's the tea, bestie. r.carve accepts vector stream data as input, transforms them to raster, and subtracts a default-depth + additional-depth from a DEM. yes, both. it's an and, not an or. π«Ά
If the given width is more than 1 cell, it will carve the stream with the given width. slay.
With the -n flag it should eliminate all flat cells within the stream, so when and if the water gets into the stream it will flow. iconic.
The points option generates x,y,z for points which define the stream with the z-value of the bottom of the carved-in stream. These points can then be combined with contours to interpolate a new DEM with better representation of valleys. it's giving β¨chef's kissβ¨ honestly.
π NOTES π
r.carve does not create a depressionless DEM, because many depressions are in flat areas and not in the streams. so like, don't come for her about the depressions, that was never the assignment. π
β EXAMPLE β
North Carolina sample dataset, let's gooo:
# set computational region
g.region raster=elev_lid792_1m -p
# digitize a ditch for the farm pond
echo "L 3 1
638692.93595422 220198.90026383
638737.42270627 220149.74706926
638984.43306379 220148.19158842
1 1" | v.in.ascii -n input=- output=ditch format=standard
# visualize original data
d.mon wx0
d.rast elev_lid792_1m
d.vect ditch
# carve
r.carve raster=elev_lid792_1m vector=ditch output=carved_dem width=3 depth=0.5
# visualize resulting carved DEM map
d.rast carved_dem
# visualize
r.relief input=elev_lid792_1m output=elev_lid792_1m_shaded
r.relief input=carved_dem output=carved_dem_shaded
d.rast elev_lid792_1m_shaded
d.erase
d.rast carved_dem_shaded
# flow accumulation
r.watershed elevation=elev_lid792_1m accumulation=elev_lid792_1m_accum
r.watershed elevation=carved_dem accumulation=carved_dem_accum
d.rast elev_lid792_1m_accum
d.erase
d.rast carved_dem_accum
# differences
r.mapcalc "accum_diff = elev_lid792_1m_accum - carved_dem_accum"
r.colors accum_diff color=differences
d.erase
d.rast accum_diff
and now the visuals, bestie, because numbers alone are not the vibe:
- Fig: Original 1m LiDAR based DEM with vector streams map on top
- Fig: Original 1m LiDAR based DEM shown as shaded terrain
- Fig: Carved 1m LiDAR based DEM
- Fig: Carved 1m LiDAR based DEM shown as shaded terrain
- Fig: Flow accumulation in original 1m LiDAR based DEM
- Fig: Flow accumulation in carved 1m LiDAR based DEM
π KNOWN ISSUES π
The module does not operate yet in latitude-longitude coordinate reference system. nope, not yet, she's not ready for that.
It has not been thoroughly tested, so not all options may work properly β but this was the intention. π yes really, that's what it says. the chaotic energy is documented and canon.
π REFERENCES π
Terrain modeling and Soil Erosion Simulations for Fort Hood and Fort Polk test areas, by Helena Mitasova, Lubos Mitas, William M. Brown, Douglas M. Johnston, GMSL (Report for CERL 1999)
π SEE ALSO π
r.flowr.fill.dirr.watershed
π AUTHORS π
- Bill Brown (GMSL)
- GRASS 6 update: Brad Douglas
π SOURCE CODE π
Available at: r.carve source code (history)
Latest change: Thursday Feb 13 11:55:34 2025 in commit: ffc0b8c9c71c2c78415bb0db0bd9d7daea963353
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie π«Ά Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual β and yeah, this was GRASS 8.5.0, r.carve(1grass). go carve something gorgeous. π
β¨
π¦ 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