navit-project.org

forum for navit navigation tool
It is currently 19 Oct 2018, 01:13
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  [ 1 post ] 
Author Message
 Post subject: Conversion to and from Cartesian Coordinates
PostPosted: 22 Sep 2018, 19:18 
Offline

Joined: 26 May 2018, 04:33
Posts: 4
Hey guys,

I'm not sure exactly where this belongs, but I'm trying to externally insert bookmarks into the bookmark file, but it looks like they need to be in cartesian format. I've been digging around, trying to find the formula for converting to and from cartesian, and I think I found it in transform.c (https://github.com/navit-gps/navit/blob ... #L264-L304), but I was trying it out, and it wasn't matching the examples given on the "Coordinate format" page (http://wiki.navit-project.org/index.php ... ate_format).

Here's what I tried:
0x13a3d7, 0x5d6d6d -> 1287127, 6122861 == 48.82356, 11.345252

lat = navit_atan(exp(c->y/6371000.0))/M_PI*360-90 = atan(exp(6122861/6371000.0))/PI*360-90 = 48.1373
long = c->x/6371000.0/M_PI*180 = 1287127/6371000.0/PI*180 = 11.5754

Which is close, but not great. I also tried it with coordinates automatically put in the bookmarks file and it was off by a ton. I don't have access to those numbers right now, but I'll post a comment later, when I do.

Am I doing something wrong? Is there a different formula out there, or am I missing a step beforehand?


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

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