-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
152 lines (148 loc) · 4.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<html>
<head>
<title>lon, lat, lon: which map software uses which coordinate order?</title>
<style>
body {
width:500px;
margin:20px auto;
color:#222;
}
h1 {
text-align:center;
}
table {
border-collapse:collapse;
}
thead th {
text-align:left;
}
td {
width:50%;
border:1px solid #444;
}
</style>
</head>
<body>
<h1>lat lon lat lon lat lon lat</h1>
<table width='100%'>
<tr>
<thead>
<th>lon, lat</th>
<th>lat, lon</th>
</thead>
</tr>
<tr>
<th colspan=2>formats</th>
</tr>
<tr>
<td>
<ul>
<li>GeoJSON
<li>KML
<li>Shapefile
<li>WKT
<li>WKB
<li>geobuf
</ul>
</td>
<td>
<ul>
<li>GeoRSS
<li>Encoded Polylines (Google)
</ul>
</td>
</tr>
<tr>
<th colspan=2>javascript apis</th>
</tr>
<tr>
<td>
<ul>
<li>OpenLayers
<li>d3
<li>ArcGIS API for JavaScript
<li>Mapbox GL JS
</ul>
</td>
<td>
<ul>
<li>Leaflet
<li>Google Maps API
<li>Tangram
</ul>
</td>
</tr>
<tr>
<th colspan=2>mobile apis</th>
</tr>
<tr>
<td>
<ul>
</ul>
</td>
<td>
<ul>
<li>Google Maps iOS/Android
<li>Apple MapKit
</ul>
</td>
</tr>
<tr>
<th colspan=2>misc</th>
</tr>
<tr>
<td>
<ul>
<li>OSRM<sup><a href='https://github.com/Project-OSRM/osrm-backend/blob/master/CHANGELOG.md#500'>[1]</a></sup>
<li>Redis<sup><a href='http://redis.io/commands/geoadd'>[1]</a></sup></li>
</ul>
</td>
<td>
<ul>
</ul>
</td>
</tr>
</table>
<p>A frustrating inconsistency in geospatial (mapping) software is coordinate
order. Coordinates are often represented as arrays, like <code>[-87.73, 41.83]</code>,
instead of objects, like <code>{ lng: -87.73, lat: 41.83 }</code>. This leaves
it up to the developer to determine whether -87.73 is the longitude or latitude.
One choice places a point on Chicago, and the other a location deep in Antarctica.
</p>
<p>There's some consensus growing around longitude, latitude order for geospatial
formats, but still chaos for libraries and software. It's up to
the developer to be aware of this issue and read the requisite documentation,
and flip coordinates if necessary to translate between different systems.</p>
<h3>FAQ</h3>
<dl>
<dt>Which is right?</dt>
<dd>Neither. This is an opinion with no right answer. Geographical tradition
favors lat, lon. Math and software prefer lon, lat.</dd>
<dt>What about GPX or OSM XML?</dt>
<dd>Formats that represent lat and lon with separate XML attributes don't
enforce any coordinate order, because XML attributes are not ordered.</dd>
<dt>What about GML?</dt>
<dd>GML doesn't make any statement about coordinate order: it allows
the datum to dictate the order, so some data may be longitude, latitude
and other data the reverse.</dd>
<dt>Why is the cartographic tradition to put latitude first?</dt>
<dd>There are many theories. The most convincing is that <a href='https://en.wikipedia.org/wiki/History_of_longitude'>since we were
able to judge latitude much earlier than we could judge longitude, we put it first.</a></dd>
<dt>What about ISO 6709 - did the ISO standardize on lat, lon?</dt>
<dd>The ISO standard specifically only applies to form inputs,
not storage mechanisms, software or formats.</dd>
</dl>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '56a61d21bb922a3646002601');
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif');
t.src = 'https://d36ee2fcip1434.cloudfront.net/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>