NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum



I want to pass some instructions on how to reach a certain place to friends. Several routes are available with advantages and disadvantages (like shortest route, fastest route, prettiest route, most fun route,...).

A simple solution would be to download the map tiles and then use a graphic editor such as gimp and add a transparent colored line covering the routes I recommend. Then I can share the resulting image file and I have the desired effect. The problem is, that I need to repeat this task over and over if the map updates (at least if I want my map to be up to date as well) and people can't scroll or zoom.

Next solution would be to create a little html/javascript page that uses OpenLayers. But then I need a gpx-trace for all the routes. Where get those from short of driving the entire routes again? After all OSM has all the traces. I played with JOSM a little to figure out whether I can export some roads as GPX, but I could only figure out how to export entire layers which is clearly to much. Does anyone know a tool for extracting GPX files for a certain route from OSM?

I am open for other ideas as well.

asked 14 Sep '11, 19:52

yankee's gravatar image

accept rate: 0%

edited 10 Aug '14, 15:48

aseerel4c26's gravatar image

aseerel4c26 ♦

I know the present OSM html renderer is tile-based, but from potlach for instance, could we print the webpage to a vectorial pdf? If yes then one then can reedit this with any serious vector drawing application (ie, capable to "eat" vector pdf), just highlighting the ways of interest and changing their draw attributes...

Another point: did you check all the open OSM-based routers around, which may offer you up-to-date pages with the right routing preset?

(15 Sep '11, 13:31) Herve5

@Herve5: partially does not place the overlay over the road for some reason, on the target road is not in so far (it's obviously not through the tile cache since parts a visible on some zoom levels, even though I added the road in April), I could not get to calculate any route at all, MapQuest is ok, except for one road which involves a track (MapQuest refuses to use that track). Any more proposals?

(15 Sep '11, 18:23) yankee

Have you tried To route over tracks, you would need to choose the Pedestrian or Bicycle Profile. Besides GPX download you could also simply send a "Route link".

(17 Sep '11, 14:49) ikonor
(18 Sep '11, 19:45) Herve5

You could get the whole layer into JOSM, select your route, then make an inverse selection so everything else is selected. Now go to EDIT->PURGE (do NOT DELETE instead) and export the result as GPX.

Btw.: I doubt you would have to change your GIMP-overlay very often. Mostly the route overlay would not change when the map slightly changes (simply keep the layers separate and exchange the map underneath), but I agree that an openlayers overlay is nicer.

permanent link

answered 15 Sep '11, 23:04

dieterdreist's gravatar image

accept rate: 3%


OK, well... That IS a lot of work! But it works! So here's the stuff in more detail:

  1. Select all ways to be included (possibly have to split ways)
  2. Edit → Search → "child selected" to select the nodes for the ways as well. Check "add to selection".
  3. Edit → Search → "-selected" to inverse selection. Check "replace selection".
  4. Edit → Purge
  5. Right click the data layer → export to GPX
  6. Follow these instructions to display the track: Openlayers_Track_example
(16 Sep '11, 12:25) yankee

The old reply to a query may help in some way ... or not? Using josm right-click over the Downloaded GPX Data in the layers pane, then select Info - you'll see a table of tracks with some of them showing links in the URL column which you then can select and copy into your browser.

(10 Aug '14, 17:13) nevw

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 14 Sep '11, 19:52

question was seen: 17,334 times

last updated: 10 Aug '14, 17:17

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum