-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix:#1218 #1219
base: trunk
Are you sure you want to change the base?
Fix:#1218 #1219
Changes from 25 commits
68afffb
5a0288b
e3cb9c2
fd91e40
be87cd3
a2ffdea
31c48d4
90ff624
ae572cc
57cba4e
381e544
64c5eab
be53f3d
34fcdb9
ca0fd3c
7620dc4
5d0bfe0
223b8b3
fb0afeb
90d36d7
7c2492a
c187fda
d9c0f97
4f64b74
c3dba1b
1167d94
55f0c86
8a3fa0d
cf5587b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
Coordinates in Navit | ||
==================== | ||
|
||
Various parts of Navit will read geographical coordinates provided as | ||
text: | ||
|
||
- the `textfile <https://wiki.navit-project.org/index.php/Textfile>`__ | ||
map format | ||
|
||
- the "center=" attribute in the configuration file | ||
|
||
- some Navit commands (e.g. set_position), which can be invoked via | ||
the `internal | ||
GUI <https://wiki.navit-project.org/index.php/Internal_GUI>`__ or the | ||
`Dbus <https://wiki.navit-project.org/index.php/Dbus>`__ bindings | ||
|
||
- the files for bookmarks and last map position (bookmarks.txt and | ||
center.txt) | ||
|
||
This page documents the coordinate systems and formats that Navit will | ||
accept. | ||
|
||
Supported coordinate systems and formats | ||
======================================== | ||
|
||
.. _longitude--latitude-in-decimal-degrees: | ||
|
||
Longitude / Latitude in decimal degrees | ||
--------------------------------------- | ||
|
||
Longitude / latitude in degrees can be specified as signed decimal | ||
fractions: | ||
|
||
.. code:: | ||
|
||
-33.3553 6.334 | ||
|
||
That would be about 33° West, 6° North. Note that in this format | ||
longitude comes first. The coordinates are assumed to be based on WGS84 | ||
(the coordinate system used by the GPS system, and by practically all | ||
common navigation systems). | ||
|
||
.. _latitude--longitude-in-degrees-and-minutes: | ||
|
||
Latitude / Longitude in degrees and minutes | ||
------------------------------------------- | ||
|
||
Latitude / Longitude can also be specified in degress and minutes with | ||
compass directions (N/S, E/W): | ||
|
||
.. code:: | ||
|
||
4808 N 1134 E | ||
|
||
Latitude and longitude are multiplied by 100, so the position above | ||
corresponds to 48°8' N, 11°34' (Munich). | ||
|
||
For greater precision you can write the minutes as decimal fractions: | ||
|
||
.. code:: | ||
|
||
4808.2356 N 1134.5252 E | ||
|
||
That is 48°8.2356' N 11°34.5252' E, the center of the Marienplatz in | ||
Munich. | ||
|
||
Notes: | ||
|
||
- This format is rather unusual (because it uses arcminutes, but not | ||
arcseconds). It is probably easier to just use decimal fractions of | ||
degrees. | ||
|
||
- The spaces are relevant for parsing. Use exactly one space between | ||
the number and the letter N/S/E/W. | ||
|
||
Cartesian coordinates | ||
--------------------- | ||
|
||
Internally, Navit uses a cartesian coordinate system induced by a | ||
Mercator projection. Coordinates are written as hexadecimal integers: | ||
|
||
.. code:: | ||
|
||
0x13a3d7 0x5d6d6d | ||
|
||
or specifying a projection: | ||
|
||
.. code:: | ||
|
||
mg: 0x13a3d7 0x5d6d6d | ||
|
||
That is again 48°8.2356' N 11°34.5252' E. The part up to and including | ||
the colon is optional, it names the projection to use. Possible values: | ||
|
||
- mg - the projection used by Map&Guide (the default) | ||
|
||
- garmin - "Garmin" projection (TODO: When would it be useful?) | ||
|
||
This format is used internally by Navit, but is probably not very useful | ||
for other purposes. | ||
|
||
Google Maps Format | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That makes it sound like Google invented this format. Can’t we put this more nicely (e.g. decimal WGS84 lat/lon)? Also, since this is closely related to the other WGS84 formats, why not move it closer to them? |
||
------------------ | ||
|
||
.. code:: | ||
|
||
48.137260, 11.575420 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since there is another WGS84 decimal format, albeit with longitude before latitude, how does Navit know which of the two is meant (i.e. order of coordinates)? Or, what do I need to pay attention to when supplying these coordinates so Navit interprets them correctly (avoiding coordinates being swapped)? |
||
|
||
That is again 48°8.2356' N 11°34.5252' E. The values are comma | ||
separated. You can pick such values from Google Maps with right click on | ||
a location and then click on the coordinate in the context menu. This is | ||
useful when planning a route online by creating a waypoint file. | ||
|
||
UTM coordinates | ||
--------------- | ||
|
||
Navit can read coordinates in the `Universal Transverse Mercator | ||
coordinate | ||
system <http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system>`__ | ||
(UTM). | ||
|
||
.. code:: | ||
|
||
utm32U: 674499.306 5328063.675 | ||
|
||
.. code:: | ||
|
||
utmref32UPU:74499.306 28063.675 | ||
|
||
Development notes | ||
================= | ||
|
||
The coordinates are parsed in function coord_parse() in coord.c. This | ||
code is used everywhere where Navit parses coordinates, except for the | ||
manual coordinate input in the Internal GUI (which uses its own format | ||
and parsing function). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK this is for legacy reasons: Navit was started around 2002 (source code was released later). Note that this predates OSM – the first versions used commercial map data, including Garmin. Hence there would have been a need to support their coordinate system. This probably also explains why Navit internally uses
mg
rather than WGS84.