How to generate topographic contours using FOS tools?

For the creation of the OPM Mars Basemap, we have used pre-generated MOLA-based contours lines by @thare using the commercial Global Mapper software (v18), which has smoothing and removing of small features built-in. These contours were generated using:

  • Intervals: 200m and 1km
  • Smoothing 7x7 box over DEM
  • Smooth lines but with a simplify of 0.1
  • Any feature less than 2km in length were removed

As we are creating basemaps for other bodies (eg. Moon, Mercury), we would like to be able to produce similar quality (or better) contours lines from any scale DTM data products (local or regional), using free and open source (FOS) software.

We propose to experiment with gdal_contour and other tools people might know.


1 Like

What’s the problem with gdal_contour?

We’ll figure it out! :wink:

Perhaps GRASS can help to smooth?
Mapserver (but is that only on-the-fly?):

for pre-processing (smoothing) a DEM there is:
GRASS again:
filtering in a GDAL VRT (kernels or using Python):
GDAL and numpy, scipy:
GIS Jake:

large winding discussion on filtering:

1 Like

for smoothing what I diid is to subsample MLA, then this

the result (1km and 2km contours) is on

For smoothing after creating vector lines, you can also use PostGIS. It has a great simplify function implemented:

The algorithm seems to be available in Pyhton as well:

1 Like