OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2011-12-18 17:31:20

How to convert OSM-data into GPX-format

I would like to convert OSM data from http://download.geofabrik.de/osm/europe/  ( extension .pbf or bz2 or shp.zip) to GPX format. I would also like to filter some elements before conversion based on OSM tagging. For example only  highway=track and surface= unpaved. Is there a tool for this?

Offline

#2 2011-12-18 20:06:54

Re: How to convert OSM-data into GPX-format

Offline

#3 2011-12-18 20:29:45

Re: How to convert OSM-data into GPX-format

for filtering, have a look at http://wiki.openstreetmap.org/wiki/Osmfilter

Offline

#4 2011-12-18 22:14:25

Re: How to convert OSM-data into GPX-format

I have installed GPSBabel on my W7 machine. I see a window in which I can specify input and output files. so far I have converted 1 .osm file into a .gpx file. In the given link to GPSBabel I see an example with parameters "gpsbabel -i gdb -f ways.gdb -o osm,tag="highway:motorway" -F ways.osm ".

Can these kind of things be inputted in the windows interface? If so, can someone explain how to do this?

Offline

#5 2011-12-18 23:02:14

chris66
OSM Addict
From: Germany
Registered: 2009-05-24
Posts: 4,901

Re: How to convert OSM-data into GPX-format

The editor JOSM can also convert OSM to gpx. But of course not whole europe, that's to much data. wink


OSM-Karten werden von Kindern und Jugendlichen ohne kartografische Kenntnisse gebastelt.

Offline

#6 2011-12-19 09:10:51

Re: How to convert OSM-data into GPX-format

PeeWee32 wrote:

I have installed GPSBabel on my W7 machine. I see a window in which I can specify input and output files. so far I have converted 1 .osm file into a .gpx file. In the given link to GPSBabel I see an example with parameters "gpsbabel -i gdb -f ways.gdb -o osm,tag="highway:motorway" -F ways.osm ".

Can these kind of things be inputted in the windows interface? If so, can someone explain how to do this?

In the GPSBabel GUI the Options button shows the parameter selection box if you have selected the OSM format first. But those parameters cannot be used for filtering the input data in OSM format. They affect only the output into OSM format so that it is possible to add automatically certain OSM tags into each node or feature. You must use other tools for filtering the OSM data.

Offline

#7 2011-12-19 18:57:36

Re: How to convert OSM-data into GPX-format

JRA wrote:

In the GPSBabel GUI the Options button shows the parameter selection box if you have selected the OSM format first. But those parameters cannot be used for filtering the input data in OSM format. They affect only the output into OSM format so that it is possible to add automatically certain OSM tags into each node or feature. You must use other tools for filtering the OSM data.

Any suggestions?

Offline

#8 2011-12-19 22:26:04

Re: How to convert OSM-data into GPX-format

PeeWee32 wrote:
JRA wrote:

In the GPSBabel GUI the Options button shows the parameter selection box if you have selected the OSM format first. But those parameters cannot be used for filtering the input data in OSM format. They affect only the output into OSM format so that it is possible to add automatically certain OSM tags into each node or feature. You must use other tools for filtering the OSM data.

Any suggestions?

As stephan75 wrote above, osmfilter might be useful for this purpose. You also could use Osmosis for filtering. An osmfilter example:

osmconvert my_osm_file.pbf -o=my_osm_file.o5m
osmfilter my_osm_file.o5m --keep="highway=motorway" -o=motorways.osm

Offline

#9 2011-12-21 22:37:32

Re: How to convert OSM-data into GPX-format

Thanks Marqqs

I've already used osmconvert to convert .osm file  to o5m. I also already changed a small .osm file to .gpx with gpsbabel. Righ now osmfilter is running to make a new filtered .osm file so I hope I will eventually get what I was looking for.

Cheers Peewee

Offline

#10 2011-12-29 15:17:08

Re: How to convert OSM-data into GPX-format

I have managed to convert OSM data into GPX using OSMconvert, OSMfilter and finally GPSBabel. But I still have one question .

I now have a GPX file containing many routes en waypoints.

The GPSBabel command was

gpsbabel -i osm -f output.osm  -o gpx -F output.gpx

This apperently produces the GPX file with the routes/waypoint. Is there a way to convert the filtered OSM file (output.osm) into a output.gpx that only has tracks (instead of routes/waypoints)?

Offline

#11 2011-12-29 15:26:38

Re: How to convert OSM-data into GPX-format

PeeWee32 wrote:

Is there a way to convert the filtered OSM file (output.osm) into a output.gpx that only has tracks (instead of routes/waypoints)?

Filters -> Miscellaneous
Nuke [x] Waypoints
[x] Transform Routes->Tracks [x] delete

HTH,
ajoessen

Offline

#12 2011-12-30 10:27:06

Re: How to convert OSM-data into GPX-format

Thanks

Works great.

Offline

Board footer

Powered by FluxBB 1.4.8
Hosting sponsored by Oxilion