This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

displaying Dijkstra result as a route in real map

0

So I got the result of Dijkstra as sequence of coordinates

lat_1,lon_1
lat_2,lon_2
....
....
lat_n,lon_n

where lat_1,lon_1 is the start point and lat_n,lon_n is the end point of the vehicle route. I need to display this path on real map. After adding node_id and description, I used GPSVisluazer website to create GPX file. I opened it in jpeg and Google Map and all show just set of points or markers with no connected lines between them. Now my question is: how to display the result of Dijkstra on OSM or at least having it as image? I checked rendering and routing sections in openstreetmap.org but there is nothing obvious.

asked 17 Jun '16, 12:50

xline's gravatar image

xline
11223
accept rate: 0%


One Answer:

2

If you have a gpx with waypoints and just want a straight line joining the points, you could use a text editor and replace the 'wpt' tags with 'trk' tags and then the points will be joined by a line when viewed in gpsvisualizer. I haven't tried this but it should be easy enough if you open an example of a gpx track to use as an example. I suspect you instead require a road route between the points, and if so, you can upload the gpx file of the waypoints to a site like www.gpsies.com and draw a route to each point.
Example of correct tags here https://wiki.openstreetmap.org/wiki/GPX

answered 17 Jun '16, 17:10

nevw's gravatar image

nevw
9.8k2690178
accept rate: 9%

edited 17 Jun '16, 17:46

Source code available on GitHub .