navit-project.org

forum for navit navigation tool
It is currently 26 Jun 2017, 07:05
View unanswered posts | View active topics


All times are UTC


Forum rules


Feel free to ask anything here related to the development process - coding, creating new features, fixing bugs and custom changes of Navit.

Note: For reporting bugs, use the bug tracker.



Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [solved] Route path coordinates
PostPosted: 14 Jun 2013, 12:53 
Offline

Joined: 14 Jun 2013, 12:09
Posts: 10
hey,

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...


 Profile  
 
 Post subject: Re: Route path coordinates
PostPosted: 15 Jun 2013, 06:30 
Offline
User avatar

Joined: 07 Jun 2013, 09:32
Posts: 200
Location: Rostock, North Germany
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?
https://wiki.navit-project.org/index.php/Dbus


 Profile  
 
 Post subject: Re: Route path coordinates
PostPosted: 19 Jun 2013, 12:07 
Offline

Joined: 14 Jun 2013, 12:09
Posts: 10
thanks to cp15 from freenode.net i got the answer i needed.
one need to enter following code in the function route_path_update_done() from the file route.c
Code:
   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
--SOLVED--


 Profile  
 
 Post subject: Re: [solved] Route path coordinates
PostPosted: 19 Jun 2013, 14:33 
Offline
User avatar

Joined: 07 Jun 2013, 09:32
Posts: 200
Location: Rostock, North Germany
Great to hear.
I changed the title, but as it's very code centric, I think we will keep your post here.


 Profile  
 
 Post subject: Re: [solved] Route path coordinates
PostPosted: 21 Jun 2013, 09:22 
Offline

Joined: 14 Jun 2013, 12:09
Posts: 10
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


Attachments:
Screenshot.png
Screenshot.png [ 46.53 KiB | Viewed 5506 times ]
 Profile  
 
 Post subject: Re: [solved] Route path coordinates
PostPosted: 21 Jun 2013, 09:28 
Offline
User avatar

Joined: 07 Jun 2013, 09:32
Posts: 200
Location: Rostock, North Germany
I'm not sure if it IS the reason, but Navit handles WGS84 coordinates a tip different:
http://wiki.navit-project.org/index.php/Binfile
  • different earth radios
  • limited resoulution

Can you try to form a reprojection in your GIS?


 Profile  
 
 Post subject: Re: [solved] Route path coordinates
PostPosted: 24 Jun 2013, 11:22 
Offline

Joined: 14 Jun 2013, 12:09
Posts: 10
Thank you for these hints.

I did not use a GIS for this plot. I used python with the pyshp library https://pypi.python.org/pypi/pyshp to plot my shapefile from cloudemade.com.
I also plotet the original osm file with http://dataorigami.blogspot.de/2010/10/beta-release-how-to-render.html. 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?


 Profile  
 
 Post subject: Re: [solved] Route path coordinates
PostPosted: 24 Jun 2013, 12:24 
Offline
User avatar

Joined: 07 Jun 2013, 09:32
Posts: 200
Location: Rostock, North Germany
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...


 Profile  
 
 Post subject: Re: [solved] Route path coordinates
PostPosted: 24 Jun 2013, 12:38 
Offline

Joined: 14 Jun 2013, 12:09
Posts: 10
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.

-EDIT-
Quote:
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.


 Profile  
 
 Post subject: Re: [solved] Route path coordinates
PostPosted: 06 Nov 2013, 14:42 
Offline

Joined: 06 Nov 2013, 14:30
Posts: 11
Hello,

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 http://wiki.navit-project.org/index.php/OSD#route_guard

Many thanks


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Silver Orange 2.0.6 for IPB Designed by Skins and Hosting
Converted for phpBB3, based on Royal Blue template by BigB © 2007 2008 AEON KINGS