This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

coordinate format LatLon vs LonLat

1

Hi,

I am trying to write a small tool but I am more and more confused. What is the correct (or the best) way to present the result coordinates? LatLon or LonLat? Seems every application decides for itself.

OSM GPS Planet ->latlon

Polygon File (*.poly) ->lonlat

Garmin CSV ->lonlat

OGR (csv) ->LatLon

KML ->LonLat

ISO 6709 ->LatLon

Basic coordinate system (xy) ->lonlat

asked 30 Apr '12, 10:41

SunCobalt's gravatar image

SunCobalt
15112
accept rate: 0%


2 Answers:

2

Stuff that deals with latitude and longitude exclusively tends to list latitude first, then longitude.

Stuff that deals with some abstract sort of coordinates, which might be latitude and longitude but could also be any kind of projected x/y, tends to list longitude first, then latitude.

For specifying bounding boxes, most programs use the sequence west-south-east-north, or minlon-minlat-maxlon-maxlat but even that is not always the same.

answered 30 Apr '12, 10:54

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

1

The only thing worse then no standard is two standards that is indistinguishable. Just be sure that you document what way you use. I prefer latlon because it is an iso standard and the tools I use tend to use that format, but there are no real advantages to using one over the other.

If you are writing a tool that is taking input from or output to programs with unknown order make sure to add an option to swap the coordinates.

answered 30 Apr '12, 10:58

Gnonthgol's gravatar image

Gnonthgol ♦
13.8k16103198
accept rate: 16%

Source code available on GitHub .