GeoJSON across the antimeridian: check the selected IDs, not just the count
Two exports both contain two points. One selects the intended Pacific strip; the other selects points elsewhere. The mistake can begin with a tidy-looking “repair”: sorting a bounding box’s longitude endpoints from smallest to largest.
In a GeoJSON box that crosses 180° longitude, the eastern longitude can be numerically smaller than the western one. Preserve that direction before filtering records. A count that stays unchanged can conceal a completely different selection.

A box has a direction around the globe
For a two-dimensional GeoJSON bbox, read the entries as west, south, east, north. The antimeridian is the meridian at 180° east/west. Crossing it changes the longitude notation from positive to negative without jumping to the opposite side of the planet. RFC 7946, section 5.2 describes this wrapping box.
Use this synthetic rectangle, expressly chosen to cross the antimeridian:
[179, -12, -178, -8]
// west, south, east, north
Its eastward longitude span is one degree from 179 to 180, then two degrees from −180 to −178: three degrees altogether. Sorting the longitude bounds produces [-178, -12, 179, -8], a different rectangle covering 357 degrees of longitude. Neither number is an area or a travel distance.
Do not interpret every unexpected number as a crossing. Check the source’s intended region and format first. A file may instead contain a sign error, a different coordinate system or unidentified axes. The coordinate-format guide covers those earlier checks.
Five points expose the mistake
The following invented points are training data, not locations of people or events. Each pair is longitude, then latitude. Compare membership in the original box with membership after sorting:
| ID | Coordinates | Original crossing box | Sorted box |
|---|---|---|---|
| P | [179.5, -10] | Inside | Outside |
| Q | [-179, -10] | Inside | Outside |
| R | [0, -10] | Outside | Inside |
| S | [178, -10] | Outside | Inside |
| T | [179.5, -13] | Outside | Outside |
The correct IDs are P and Q. The sorted box yields R and S. Both selections contain two records, so a row-count check passes while every selected identity changes. T helps check a different condition: a suitable longitude cannot compensate for a latitude outside the box.
For this simple rectangle, with coordinates expressed within −180 to 180, the decision is:
latitude is between south and north, inclusive
AND
if west <= east:
longitude is between west and east, inclusive
otherwise:
longitude >= west OR longitude <= east
We checked those memberships and angular spans with local arithmetic. That is not a test of a GIS importer, map renderer or real trajectory. This rule is a rectangular selection exercise, not a general polygon-intersection algorithm. Exact seam endpoints, polar regions and other longitude conventions require their own documented handling.
Fix the selection and the drawn geometry separately
A correct box does not repair an incorrectly represented line. RFC 7946 recommends cutting crossing geometries at the antimeridian into parts. For a line, that can mean a MultiLineString. The intended path must be established before changing its representation.
If a conversion is necessary, keep the input and create a separate output. Record the tool version and options. GDAL’s GeoJSON driver documentation distinguishes west/south/east/north from min/max order. Its RFC7946 creation option defaults to NO; the documented WRAPDATELINE heuristics apply when transformation occurs or RFC7946 output is requested. Do not assume a filename ending in .geojson establishes the conversion settings.
The separate ogr2ogr wrapdateline option splits crossing geometry. We have not run that converter for this exercise. A plausible-looking output still needs a comparison of feature IDs, properties and geometry with the retained source.
Give the next reviewer a reproducible selection
Save the original bbox, named axis order, coordinate convention, intended region and exact selection rule. Include the retained and excluded IDs for a small check sample. If the file contains lines or polygons, separately record any geometry split and whether identifiers were preserved.
For the exercise, the useful result is: “The intended crossing extent spans three degrees in longitude and retains P,Q. Sorting its longitude bounds instead retains R,S despite the equal count.” A screenshot of two dots would not preserve that distinction.
Before accepting an export, compare a few known IDs on both sides of the seam. If the next question is distance rather than membership, move to the distance-method check instead of converting this angular span directly into kilometres.
By OSINT Jet · Primary sources reviewed 17 November 2026.
