Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have around 100 shapefiles of contours (1m interval) that I need to turn into DEMs; Is there a way to batch create these mde from contour lines? Using open source preferably.

share|improve this question
There is a discussion about how to do this with gdal here:… – djq Jan 2 '12 at 19:51
This is exactly what I need to do, thanks for the link. – jdeltoro1973 Jan 3 '12 at 18:27
@djq Please post your comment as an answer. – underdark Jan 31 '13 at 13:25

Yes, you can do that in GRASS GIS: patch them together with v.patch (or use ogr2ogr on the SHAPE file before importing them into GRASS with, then use your preferred algorithm from

Important: combine the maps before generating the DEM from it to avoid artefacts at the tile borders.

share|improve this answer
the problem is that this would generate a very large DEM. I was looking something more like a script so I can create one MDE pero shape file. – jdeltoro1973 Jan 3 '12 at 18:32
You can also process them one by one of course. But be sure to have some overlap, otherwise you will get ugly artifacts at the tile borders (create a shaded map from the resulting DEM then to verify). – markusN Jan 5 '12 at 0:48

You can use the SAGA CMD tools, which let you process shapefiles and get interpolated DEMs in a batch mode, both on Linux and Windows. Shapefiles are accessed by default in SAGA, and as interpolators, you have the possibility to choose from several spline algorithms or TIN. The DEM will be saved in SAGA format (.sgrd), but after you can export it to .asc or any other GDAL supportable format. Also in GRASS you can do the job, by creating a .sh scripts. You can use a for each code.

share|improve this answer

Your Answer


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.