Opened 8 years ago

Closed 8 years ago

#1248 closed defect/bug (fixed)

First Use map position not decoded correctly.

Reported by: davo Owned by: KaZeR
Priority: major Milestone:
Component: core Version: git master
Severity: normal Keywords: center=


When used for the first time, and install of Navit (on Linux at least) incorrectly decodes the center= setting from navit.xml.

center="4808 N 1134 E" works center="48.08 11.34" does not work

The wiki, indicates both are acceptable. Most new users would find the second form more familiar but thats the one that fails.

Easily reproduced, delete ~/.navit/center.txt, set navit.xml to contain the center= setting as above and start it up.

I am not sure where the map is centered but its somewhere where I don't have maps for. Once navigated to a valid map position, the problem goes away but its an important barrier to new user.

There are a couple of mentions of blank yellow screen in the bug list, some may be related to this problem and users gave up. Sad.

Can provide logs if needed. Identified in SVN of a few days ago. Mentioned in Forum


Change History (3)

comment:1 Changed 8 years ago by davo

OK, think I have made some sense of this issue.

Firstly, in the coord.c:260 the long and lat parameters to sscanf have been reversed. Or maybe.

The wiki offers a couple of ways of specifying the initial position. But none are clear.

Firstly, this rather strange center="4808 N 1134 E" format. In that, I believe, we are seeing lat=48 degrees, 8 minutes of lat and 11 degrees, 34 minutes long.

Secondly, center="11.34 48.08", the way the code is written, its 11.34 degrees of long, 48.08 degrees of lat. Note, long and lat reversed from above.

The third option seems to describe whats actually being applied to the first format. And, let me make it plain, it's even uglier !!

The fourth option lets us use a hex coordinate system. Yeah, sure, we all think lat/long in hex !

Gee, before I go any further, I'll wait until the more project experienced people tell me just how it really should be.

Thoughts ?

comment:2 Changed 8 years ago by sleske

Unfortunately, the Wiki is often not complete or up to date. Thank you for pointing this out. I'll have a look, and correct the Wiki (or the source code).

comment:3 Changed 8 years ago by sleske

  • Resolution set to fixed
  • Status changed from new to closed

Yes, the Wiki was rather confusing (and the code as well, in some places). I have updated the wiki page Configuration, and added a new page Coordinate format to describe the supported coordinate formats.

I also changed the default settings in navit_shipped.xml so the center attribute uses coordinates with decimal fractions; this is hopefully easier to understand (r.5909).

I hope now everything is clear :-).

About the reversal of lat/long in coord.c:260: Yes, this order is unusual, and unfortunate (because the other format uses the other order). However, we cannot change it without breaking people's textfile maps, so it will have to stay like this, I'm afraid.

Note: See TracTickets for help on using tickets.