9

In researching this I have found many references to the opposite, creating elevation data from contours, but nothing regarding contour creation. Preferably, I am looking for open source solutions like QGIS, Grass or command line tools but I am open to any suggestions that will get me pointed in the right direction.

I am planning to take the contour data into a vector drawing app for line formatting but if the app can do some of that as well it would be a major time saver.

bluefoot
  • 3,100
  • 19
  • 31
Veazer
  • 291
  • 3
  • 7

3 Answers3

11

If you are looking to convert DEMs to contour lines:

For converting scanned topo maps to vector contour lines, Arcscan is one of the easiest (and most sophisticated) programs out there. However, there are several opensource alternatives, including a promising GRASS approach:

Trace vector contours from a scanned map.

Additional information can be found here:

Aaron
  • 51,658
  • 28
  • 154
  • 317
  • Thanks, that seems to work. I love the fact the conversion can be scripted.

    I've got a lot of learning to do with QGIS.

    – Veazer Oct 24 '12 at 01:42
3

I think that GRASS module r.contour has more functinality than QGIS' one. For example, you can set maximum and minimum levels for extracting contours. Plus, it has parameter cut which makes the output more generalized.

Glorfindel
  • 1,096
  • 2
  • 9
  • 14
Vladimir
  • 1,569
  • 7
  • 15
3

Another open source option which can easily be scripted using shell scripts or python is to use GDAL_Contour to generate contours from a dem file. I grabbed some example DEM data and ran this command to generate 10 m contours, saved as a shapefile:

gdal_contour -b 1 -a elevation -snodata -9999 ns67ne.tif contour.shp -i 10

The switches are:

  • -b 1 selects the band of the image to process, which defaults to 1
  • -a elevation is the name of the contour elevation attribute which will be created
  • -snodata -9999 tells GDAL the value of nodata cells in the input raster, so they can be ignored
  • ns67ne.tif contour.shp are the input and output files, respectively
  • -i 10 is the spacing between each contour
sgrieve
  • 3,726
  • 1
  • 19
  • 36