Passage Data

Check a file →

How to tell if your latitude and longitude are swapped

Darwin Core · decimalLatitude / decimalLongitude

What you are seeing PRESUMED_SWAPPED_COORDINATE COORDINATE_OUT_OF_RANGE

The short answer

There are two versions of this problem and they are not equally solvable.

The provable one. Latitude is bounded at ±90 and longitude at ±180. A latitude of 120 is not a latitude. If the pair becomes legal when exchanged, the swap is arithmetic, not opinion. We report it as a proven swap. It works on one condition: your longitudes have to be outside ±90. That is the 90th meridian, not a continent. Australia, New Zealand and southeast Asia are always past it. The Americas and Asia straddle it: Denver at −105 is provable, Chicago at −88 is not.

The rest of the answer — 2 more points

The one the file cannot prove, and it is the common case. If every longitude sits inside ±90, both readings are legal and nothing in the file tells them apart. That is all of Europe and Africa, and South America too: a Paris longitude of 2.35 is a good latitude. We tested it on 53 published files with real coordinates: swap every one, and this proof catches 13. The other 40 are invisible to it. A header cannot settle those, because the header is what is wrong. Here we offer evidence, not proof. One reading puts your records where such records exist, the other in open ocean. We report that as suspect, not as fact.

A related failure looks nothing like a swap. A column of whole numbers from 1 to 31 is a day of the month. Mapped to latitude, it gives plausible points: a day paired with a Canadian longitude lands in the Amazon. No map inspection catches that. Only the shape of the values does.

Check the values, not the headers

We confirm every coordinate column from its values. We tell you when we can prove a swap, when we only see evidence of one, and when we cannot tell. Free during the testing period. No account needed. Without one, what we read trains our reader (names removed); signed in, nothing is kept.

Check the file you have →

Related