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: cut parameter 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