Search code examples
openstreetmapelevation

Elevation with OSM


I've been working on a routing app for the last few months and it's near completion now. The final feature I want to add is elevation. So when when running/cycling through a path, I would also wanna add the elevation data, so I know SRTM provides elevation data..but I don't know the best way to merge this with the osm xml file I'm using.


Solution

  • I don't know if there already is a program to do that. But if you have to implement it by yourself, do something like this:

    SRTM is a grid based elevation-dataset. So you can easily look up for every node in your routingnet the nearest elevation-point on the grid (for finer data you can use interpolation). For routing you already need to split up the ways at intersections. After that i would add a Tag to every way to measure the elevation (not only the difference between the start- and endpoint but). E.g. you can add two tags: one for the positive elevation, one for the negative (divides by the length of the way).

    Btw: use PBF or O5m instead of XML. It is smaller and better to process.