r.contour(1grass)
π r.contour β contour vibes from your raster, bestie π
okay so welcome to r.contour, a GRASS User's Manual page, and honestly? this one is a whole mood. it takes a raster map and β¨ makes you a vector map full of contour lines β¨. that's it. that's the serve.
KEYWORDS: raster, surface, contours, vector π
β¨ SYNOPSIS β¨
r.contour
r.contour --help
r.contour [-t] input=name output=name [step=float]
[levels=float[,float,...]] [minlevel=float] [maxlevel=float]
[cut=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]
π FLAGS π
-tβ do not make an attribute table. no table, no problem π--overwriteβ lets output files just bulldoze over existing files like it's nothing--helpβ prints the usage summary, aka "what is this again?"--verboseβ verbose module output, for when you want the module to yap--quietβ quiet module output, for when you want it to shut up (affectionately)--uiβ forces the GUI dialog to launch. yes, the little window. go off π¦
πΈ PARAMETERS πΈ
input=name[required] β name of the input raster map. the raw material, the source, the blueprint π§output=name[required] β name for the output vector map. your baby. your creation πstep=floatβ the increment between contour levels. like "every 100 meters" energylevels=float[,float,...]β a whole list of contour levels, comma-separated, one by one, no capminlevel=floatβ minimum contour level, the floor, the baselinemaxlevel=floatβ maximum contour level, the ceiling, the limitcut=integerβ minimum number of points for a contour line (and0means no limit)- Default:
2
- Default:
π DESCRIPTION π
r.contour produces a vector map of specified contours from the input raster map. it's giving cartography, it's giving terrain, it's giving "look at my pretty elevation lines."
so there's two ways to tell it what contours you want, and you pick your fighter:
- a comma-separated list of values in
levelsπ - some regular increment using the
stepparameter
when you're stepping, you use minlevel and maxlevel as the minimum and maximum contour values, respectively. and if you don't bother specifying a minlevel or maxlevel? no worries bestie, r.contour just uses the minimum and maximum cell values in the input raster map. it figured it out itself. main character energy π
π NOTES π
ok so listen closely because this one matters.
r.contour will either step through incremental contours or produce contours from a list of levels. not both. pick a lane. if you specify both a list of levels and a step, the list gets produced and the step gets ignored. literally just sitting there unread like a text left on delivered π
Zero is treated as a valid data value by r.contour. so don't be weird about it, zero is a whole valid number and it deserves respect π
β οΈ warning bestie β οΈ
If a contour level exactly matches a category value in the raster map, the contour line may backtrack on itself, which causes illegal arcs to be produced in the output vector map. not cute. not iconic. watch out for that one π
the optional cut parameter lets you specify a minimum number of raster cells eligible to be included in a contour line written to the output vector map. think of it like a filter β it omits spurs, single points, etc., which makes the output more generalized. it's the "no crumbs, no clutter" setting β¨
π EXAMPLES π
example one β the Spearfish glow-up π¦
in the Spearfish dataset, produce a vector contour map from input raster elevation.dem with contour levels from 1000m to 2000m, a 100m contour step, and a minimum of 200 input raster points contributing to the contour line:
r.contour input=elevation.dem output=elevation_dem_contours \
minlevel=1000 maxlevel=2000 step=100 cut=200
example two β levels, the list edition π
for an example of using levels with r.contour, this one uses the elevation map from the North Carolina database:
g.region raster=elevation
r.contour in=elevation out=contours levels=60,90,120,150 --o
d.mon wx0
d.rast elevation_shade
d.vect contours color=red
Contour lines shown on shaded terrain map πΈ
example three β step, the increment edition β
for an example of using steps with r.contour, this one uses the LiDAR data derived elevation map from the North Carolina database:
g.region raster=elev_lid792_1m -p
r.contour input=elev_lid792_1m output=elev_lid792_1m_contours \
minlevel=100 maxlevel=150 step=10
π AUTHORS π
- Terry Baker, U.S. Army Construction Engineering Research Laboratory
- 3/2001:
cutparameter and fixes by Andrea Aime (aaime@libero.it)
π SOURCE CODE π
Available at: r.contour source code (history)
Latest change: Monday Dec 22 18:07:47 2025 in commit: cd86ea812e29ba28776cf5a102bf59288f49ce41
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
and that's the whole page bestie, GRASS 8.5.0 and r.contour(1grass) and everything π«Ά go make some contours, you're gonna slay πβ¨
π¦ 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