r.contour(1)
π r.contour(1) β the GRASS GIS User's Manual glow-up π
okay bestie, gather round, because this is r.contour from the GRASS GIS User's Manual and she is literally the moment. she takes a raster map and hands you a vector map of contour lines. that's it, that's the gig, and she does it gorgeously. π
β¨ NAME β¨
r.contour β produces a vector map of specified contours from a raster map. no cap, that's the whole personality. π¦
πΈ KEYWORDS πΈ
raster, surface, contours, vector β iykyk π
π 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 create an attribute table. like, we're keeping it minimal, we don't need the extra paperwork bestie π--overwriteβ allow output files to overwrite existing files (yes she will absolutely body your old file, consent given tho) π«Ά--helpβ print usage summary β¨--verboseβ verbose module output, she's yapping and we love that for her π£οΈ--quietβ quiet module output, she's giving mysterious and reserved π€«--uiβ force launching GUI dialog, for the girlies who need the visual β¨π±οΈ
π§ Parameters π§
input=name[required] β name of input raster map. mandatory, queen, no skipping πoutput=name[required] β name for output vector map. also mandatory πstep=floatβ increment between contour levels, the lil regular rhythm of your contours π΅levels=float[,float,...]β list of contour levels, comma-separated, pick your faves πminlevel=floatβ minimum contour level, the floor π§maxlevel=floatβ maximum contour level, the ceiling βοΈcut=integerβ minimum number of points for a contour line (0 -> no limit). Default:2βοΈ
π DESCRIPTION π
so here's the tea: r.contour produces a vector map of specified contours from an input raster map. you've got two vibes to choose from β either you feed her a comma-separated list of values in levels, or you make her go at some regular increment using the step parameter. and when you're stepping, you use minlevel and maxlevel as your minimum and maximum contour values respectively. if you don't specify a minlevel or maxlevel, then the minimum and maximum cell values in the input raster map get used instead. she'll figure it out, she's smart like that β
π₯ NOTES π₯
listen closely bestie, this part matters:
r.contour will either step through incremental contours or produce contours from a list of levels β not both. it's giving "pick a lane." and if you do specify both a list of levels and a step, then the list gets produced and the step gets ignored. periodt. π
zero is treated as a valid data value by r.contour. zero is not the villain here, she counts π«Ά
β οΈ heads up: if a contour level exactly matches a category value in the raster map, the contour line may backtrack on itself, causing illegal arcs to be produced in the output vector map. so likeβ¦ watch out, that's real, that's canon π
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., making the output more generalized. she's editing herself for the timeline, iconic β¨
π EXAMPLES π
π Spearfish dataset π
in the Spearfish dataset, produce a vector contour map from input raster elevation.dem with contour levels from 1000m to 2000m, 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
π¦ using levels π¦
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 π
π§ using steps π§
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)
accessed: Saturday Jan 17 05:40:44 2026
main index | raster index | topics index | keywords index | graphical index | full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie, mwah π this was r.contour(1) from the GRASS 8.4.2 reference manual, GRASS GIS 8.4.2, and the source/version + date line said Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual with the access date of Saturday Jan 17 05:40:44 2026 β slay, go contour something gorgeous πβ¨
π¦ 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