srtm2wayinfo is a program that reads OpenStreetMap files and calculates the altitude differences along each way that has a \e "highway" tag. For each segment between two junctions of highways a new relation is created. This data can be used by routers to select a way with minimum altitude difference calculate better bicycle and walking routes. Of course you could also tell it to select very hilly ways.
You can get the program from SVN with this command:
The documentation is provided in doxygen format. Just run
in the main directory and open the file
in your browser. This includes user and code documentation. If you don't have doxygen installed you can also read the file "documentation.h" but it will be less comfortable.
Quick installation guide (details are provided in the documentation mentioned above)
Debian/Ubuntu As root do
apt-get install libcurl3 libcurl4-gnutls-dev libzzip-0-13 libzzip-dev libqtcore4 libqt4-dev
then in the srtm2wayinfo directory as a normal user
mkdir build cd build cmake .. make
How to use already locally available SRTM data?
Point cachdir to the directory where your keep your SRTM data.
srtm2wayinfo ... --cachedir=PATH_TO_MY_SRTM_DATA ...
Probably the data have to be in the hgt.zip format.
- absolute elevation
- peak, e.g. point of max. elevation
- point of min. elevation
- point of max. slope (both directions) incl. slope value
- points for absolute elevations of multiples of 10 meters
- configurable endpoints i.e.
- do not cut paved roads at junctions with unpaved roads
- OSM files cut with splitter.jar cause strm2wayinfo to download totally wrong srtm files. This does not happen with the splitted data from geofabrik.
- wrong tag closure
<tag k="type" v="altitude">
<tag k="type" v="altitude"/>
This is easily changable in relations.cpp.
- The output file is not directly usable with mkgmap.