DEM to contour lines

From GRASS-Wiki
Jump to: navigation, search

From DEM to vector contour lines

The extraction of isolines (in the case of an elevation surface, contours), can be derived from raster data using the module r.contour. Bu default, the module determines the minimum and the maximum isoline values for a given raster map. The isoline/contour interval should be provided by the step parameter.

Example: generate contours with a 10m interval from the raster map "elevation" (North Carolina sample dataset):

# set the computational region
g.region rast=elevation -p

r.contour elevation out=elev_contour_10m step=10

# visualize
d.mon x0
d.erase
d.rast elevation
d.vect elev_contour_10m
d.barscale -mt

The resulting contour lines are now stored in the vector map "elev_contour_10m".

Contour lines from DEM.png

See also