You are not logged in.

Announcement

*** NOTICE: forum.openstreetmap.org is being retired. Please request a category for your community in the new ones as soon as possible using this process, which will allow you to propose your community moderators.
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***

#1 2014-01-17 07:29:08

gerg1
Member
Registered: 2014-01-17
Posts: 2

Export Route Relations to GPX Files

In many cases it would be useful to export an OSM route relation data into a GPX track. For example, several biking and hiking routes exists as OSM relations, and the corresponding GPX track on a mobile device would make it easier to follow the route.

There are already some tools that accomplish this: https://wiki.openstreetmap.org/wiki/Rel … ons_to_GPX

Considering that this is a very simple process (GPX is just an XML file) that does not require much processing power, would it be possible to introduce this to the main interface on the http://www.openstreetmap.org ?

For example, when the route relation is selected using http://www.openstreetmap.org/relation/ URL, then there would be "Export as GPX" link in addition to the "Download XML" and "View History" links.

Offline

#2 2014-01-17 13:29:40

Pieren
Member
Registered: 2007-10-31
Posts: 312

Re: Export Route Relations to GPX Files

The main interface is not intended to provide services like this. OSM is mainly the database itself and a lot of tools are available to duplicate the data into other servers or applications for third parties. The main site is mainly for the contributors and the maps, a showcase to appeal new contributors.

However, when you know the route relation, you can export it in OSM format. e.g. this route relation
http://www.openstreetmap.org/relation/27683

click below on "download XML":
http://www.openstreetmap.org/api/0.6/relation/27683

on the new URL, add "/full" to retrieve all members of the relation (the ways and nodes)
http://www.openstreetmap.org/api/0.6/re … 27683/full

Now you have the route. You just need a tool to convert the OSM file format to a GPX format (search yourself).

Offline

#3 2014-01-17 19:08:18

Vclaw
Member
From: Alba
Registered: 2009-02-25
Posts: 522
Website

Re: Export Route Relations to GPX Files

For cycling or walking routes, you can use Waymarked Trails. http://waymarkedtrails.org/en/
Click on the routes button in the bottom right, then select the route you want. Then it has an option to export it as a GPX file.

Offline

#4 2014-01-18 12:59:37

gerg1
Member
Registered: 2014-01-17
Posts: 2

Re: Export Route Relations to GPX Files

Vclaw wrote:

For cycling or walking routes, you can use Waymarked Trails. http://waymarkedtrails.org/en/
Click on the routes button in the bottom right, then select the route you want. Then it has an option to export it as a GPX file.

Thanks, this was exactly what I was looking for!

I know how to do the conversion manually, but this kind of service is great for non-technical users.

Offline

#5 2014-08-13 11:12:32

voschix
Member
Registered: 2013-07-22
Posts: 9

Re: Export Route Relations to GPX Files

The GPX tracks produced from OSM routes only work if the route topology is  simple (no branches, no roundabouts, no one-way roads).

Try to ride the route "Regione Veneto I-3"  (http://cycling.waymarkedtrails.org/en/? … 79&hill=0#)
with your GPS (I presume that the smartphone apps do the same). The GPX tack produced by the WayMarkedTrails site is composed of 148 tracks (load it into Garmin MapSource to check). This is not a specific problem of the WayMarkedTrails web site but a basic problem of expressing as GPX track a complex topology.

It is near to impossible to convert manually the GPX produced from routes with complex topology into something manageable on a GPS device.

Volker

Padova, Italy

Offline

#6 2015-03-12 14:40:01

Henrique Gorni
Member
Registered: 2015-03-12
Posts: 1

Re: Export Route Relations to GPX Files

I'm new to GPS-dedicated devices and to OSM and I was just looking for this same solution because I live in Brazil and OSM gives the perfect routes for cycling in my region. The OSM interface has two options for cycling: MapQuest and GraphHopper. I couldn't find the option to export the relations generated through those two options, but when I tried the GraphHopper site, looking for an OSM relations export option, to my surprise I found an "Export to GPX" option instead smile

https://graphhopper.com/maps/

The GPX export link is right below the directions input boxes.

Offline

#7 2015-03-12 15:16:07

voschix
Member
Registered: 2013-07-22
Posts: 9

Re: Export Route Relations to GPX Files

Henrique,

I am not sure, but it seems that you use the term "route" differently from the term "route" in "route relation".

You seem to refer to a route obtained by a routing algorithm like the one that yo find on the graphhopper page that you quote.
There are several other sites that provide this service, using different algorithms.

The topic of this thread is different: it is referring to routes as waymarked (signposted) routes for cycling (or walking). These are present in OSM in large numbers and visualised by different web sites. The discussion was about converting a route relation into a gpx file that represents exactly all ways that form the relation. Example of a bicycle route (in the US): http://cycling.waymarkedtrails.org/it/relation/53722

Volker

Offline

#8 2015-08-22 17:30:54

yrtimiD
Moderator
From: Israel
Registered: 2010-10-08
Posts: 265

Re: Export Route Relations to GPX Files

Surprisingly, well known tool named GPSBabel can convert OSM data files to GPX format.
The application itself can be found at http://www.gpsbabel.org/ and its online version at http://www.gpsvisualizer.com/gpsbabel/

Ensure you select "Routes" mode, otherwise you'll get bunch of waypoints with useless osm-id names.
As input file format select "OpenStreetMap data files"
As output file format - "GPX XML"
Upload your full relation osm.xml (which can be downloaded as explained in Pieren's comment)

Offline

Board footer

Powered by FluxBB