Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
3  
did you look in qgis at the menu raster ->extraction ->contour? –  Kurt Oct 23 '12 at 18:44
    
Thanks, this is about the same as Aaron's advice. It works great. –  Veazer Oct 24 '12 at 1:43
add comment

3 Answers

up vote 10 down vote accepted

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:

share|improve this answer
    
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 1:42
add comment

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.

share|improve this answer
add comment

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
share|improve this answer
2  
Apparetly QGIS uses GDAL_Countor, so it's like QGIS works as frontend to GDAL_Contour. –  Vladimir Oct 24 '12 at 8:02
    
I didn't know that, good to know! –  sgrieve Oct 24 '12 at 8:04
1  
Not only is it a frontend for gdal_contour, QGIS shows the exact gdal_contour parameters that it will run and allows you to edit them before running it. –  Veazer Oct 25 '12 at 5:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.