[solved] Route path coordinates
Page 1 of 2

Author:  Lusipa [ 14 Jun 2013, 12:53 ]
Post subject:  [solved] Route path coordinates


i'm interested of getting the coordinates of the route calculated by navit.
I need these coordinates for the whole route right before i start driving.

For the beginnig it would be enough for me, if someone coulde tell me where (in the source code) i can put a "printf" output to get the coordinates in the terminal.

I guess, that I need to go to the "route.c" file and create an output of the "route_path" class. But i don't know in which function i should write the output and how to get the whole route_path. Because I'm only able to print a segment of the route e.g. like route->route_path->route_path_segment->c[i].x/y. And then I'm not quiet sure about how to interpret these coordinates.. there must be something special aboute the first, because it always changes and the others stay the same for some time...

i'm thankfull for any idea...

Author:  usul [ 15 Jun 2013, 06:30 ]
Post subject:  Re: Route path coordinates

Welcome Lusipa, maybe you should give us some more informations about what you try to realise. Do you need lat/lon or IDs of the internal routing graph or address based informations?

I'm not sure, if DBus will work for your?

Author:  Lusipa [ 19 Jun 2013, 12:07 ]
Post subject:  Re: Route path coordinates

thanks to cp15 from i got the answer i needed.
one need to enter following code in the function route_path_update_done() from the file route.c
   if(this->route_status == 17){   
      map_dump_file(route_get_map(this), "out_route_desc.txt");

route_status = 17 means, that every time you calculate a new route you will get an output. If you don't do so, you will get an output with every new position calculated at the beginning of the output. (route_status = 33)

I propose to move this topic to support->routing

for me, this topic is

Author:  usul [ 19 Jun 2013, 14:33 ]
Post subject:  Re: [solved] Route path coordinates

Great to hear.
I changed the title, but as it's very code centric, I think we will keep your post here.

Author:  Lusipa [ 21 Jun 2013, 09:22 ]
Post subject:  Re: [solved] Route path coordinates

Unfortunately i have to reopen this topic.

The reason is, that that waypoint coordinates produced by the output mentioned above, do not fit to the coordinates of the map file.
In the attachement you can see the map file in blue (plotted as shapefile) and the route path, plotted in red.
Some seem to fit quiet well, and others seem to be ignored.

What happened to the coordinates?
Actually i want to get the original coordinates of the of the road network and not any filtered or smoothed coordinates.

thank you

Screenshot.png [ 46.53 KiB | Viewed 12656 times ]

Author:  usul [ 21 Jun 2013, 09:28 ]
Post subject:  Re: [solved] Route path coordinates

I'm not sure if it IS the reason, but Navit handles WGS84 coordinates a tip different:
  • different earth radios
  • limited resoulution

Can you try to form a reprojection in your GIS?

Author:  Lusipa [ 24 Jun 2013, 11:22 ]
Post subject:  Re: [solved] Route path coordinates

Thank you for these hints.

I did not use a GIS for this plot. I used python with the pyshp library to plot my shapefile from
I also plotet the original osm file with The result was, that *.osm fits perfectly with *.shp. But my route from navit did not.

I tried to change the radius in my projection, but the result became even worse.

Finaly i think, that the problem is the resolution... because i think that this would explain why there are some points missing...
Does anyone have an idea how i can get the route in highest resolution... and not in the resoltution navit would draw the map?

Author:  usul [ 24 Jun 2013, 12:24 ]
Post subject:  Re: [solved] Route path coordinates

Are we talking about the lat/lon that you drove or about the expected positions within the routing graph?

For 1st case, you might log the positions to GPX/nmea to get the raw data which should have max. precision and no filtering
In 2nd I'm not sure, maybe you can get somehow real world coordinates from the nodes, or get access to OSM informations itself?

Sorry, both not very promising...

Author:  Lusipa [ 24 Jun 2013, 12:38 ]
Post subject:  Re: [solved] Route path coordinates

I would like to have the expected position within the routing graph, no measured data!
That's exactly what i would like to have: real world coordinates from the all the nodes in my route path of the underlaying osm map.

Finaly i think, that the problem is the resolution...

actualy i do not think any more that the resolution is the problem, because if i change the resolution with <navit center=... zoom=.../> in navit.xml
nothing seems to change.

Author:  Brodsbruno [ 06 Nov 2013, 14:42 ]
Post subject:  Re: [solved] Route path coordinates


I am interested in getting the route path coordinates in Lon, Lat is it possible to get it from the txt file generated earlier, or is there any other way of doing it? As Lusipa has plotted the the route and the roads in lon lat coordinates from the axis seen there i assume it is somehow possible. At the moment I have extracted the txt file and I dont understand what does it mean, and all the data in it does not really make any sence to me.

1. Could someone explain what does the txt file generated mean?
2.Could someone help me with route coordinate extraction in Lon, lat coordinates?

I also assume it is very usefull when using the route_guard function found in

Many thanks

Page 1 of 2 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group