From OpenStreetMap Wiki
Jump to navigation Jump to search


So far, SRTM2OSMsegmenter is very much an alpha release. It seems to be running stable, but be sure you read and understand the limitations. No warranties of course.

What does it do

OSM contours created with Srtm2Osm may contain very, very long ways. These long ways will quite certainly lead to artefacts when working with that data - i.e. when cutting with osmconvert/osmosis or splitting with mkgmap splitter. SRTM2OSMsegmenter will split these long ways into shorter ones. The last node of a new way will always be the first node of the next new way.


See here: Howto render Garmin contour layers with no artefacts.


.exe and C source code, MinGW is best for compiling. Latest version is 0.3.


SRTM2OSMsegmenter -i=input.osm -o=output.osm -s=250 -v -w=1

  • -i: input file (default: input.osm)
  • -o: output file (default: output.osm)
  • -s: segment length (default: 250)
  • -v: verbose mode (a lot of output, slows the whole proces down quite a bit)
  • -w: first way id in output (default: 1)


Vers. 0.3

  • -v option added
  • fixed problems with overflowing id counters (now all 64bit int)

Vers. 0.2

  • support for Srtm2Osm 1.8ext and 1.9 data added (not too extensively tested yet - let me know in case of problems)
  • proper command line parsing added
  • -w option added
  • default for segment length now 250
  • at least a bit of error handling added
  • some more whitespace stripping


  • only limited error handling yet, the tool will either work or fail silently in quite a few cases
  • if you don't use the -w option, new way id's start with 1, so merging is quite certainly a bad idea
  • no real XML parsing is done - if input is not valid, the programm will either crash or turn out broken output
  • takes only unpacked input, will only deliver unpacked output
  • no pbf support
  • The output has set OSM version 0.5 - that makes the output incompatible with some programs, i.e. the Osmosis version 0.36+.

If you have any questions or problems, don't hesitate to contact me.