[Tool] Export Relations from OSM to GPX

Started by brotbuexe, May 04, 2013, 11:14:01

0 Members and 1 Guest are viewing this topic.


Some guy made "rel2gpx".
You can get it from http://mr-unseld.de/?q=de/node/170.
It gives the ability to export Relations also known as tracks (Hiking oder Biking related) from OSM maps to GPX to use them in Locus for guiding.

Its more for advanced users, because you have to get Perl running and some modules.
You have to get a .osm Map of the area the relations you want are included. For example you can get them from http://download.geofabrik.de/ (get the osm.bz2 and unpack the bz2).
Make sure your osm is not too big. I couldn't get a 2,5GB osm work. I used only osm files with about 120MB so far.


perl -w c:pathrel2gpx.pl -i c:pathmap.osm -r bicycle -g

-r bicycle = for bicylce relations
-r hiking = for hiking relations
-g = create gpx files.

This creates gpx files for all route relations with type bicycle in the current folder.
If you want to import more then one oder two of the gpx, just zip them in one zip file and import just the zip in locus.

Because the original version have some issues with utf8 encoding (at least for me on Windows), segmentation of tracks (import in locus generates new tracks for every segment of a track) and the naming of the tracks inside the gpx and then inside of locus (only using the relation id as a name of the segments), I made some changes.

The changed version you can get from: http://www.brotbuexe.de/stuff/rel2gpx.zip


If you want exported gpx tracks (cycling, hiking, etc.) for some area, just reply, I try to export them for you (if the osm file for the area isn't too big for the script).

On http://www.brotbuexe.de/stuff/radroutengpx/ you can find the cycling routes from the german states (ISO Codes https://en.wikipedia.org/wiki/ISO_3166-2:DE). Data is from geofabrik from 04.05.2013.