Bounding box, antimeridian-aware
The smallest latitude and longitude box around points, a line, or a polygon, written west-south-east-north, crossing the antimeridian when that is shorter and reaching a pole a polygon circles.
The box runs from 170° to -170° in longitude, a 20° span, and from -17° to -15° in latitude.
- The box crosses the antimeridian, so west (170°) is greater than east (-170°), as RFC 7946 writes it.
- South
- East
- North
- Longitude span
- Crosses the antimeridian
- Pole enclosed
Provenance
- Computed by
- geometry.shape.bbox 1.0.0, core 0.1.0
- Model
- Longitudes: every point, and for a line or polygon each geodesic edge's shorter arc of longitude, marked on the circle; the box is the complement of the largest gap (RFC 7946 §5.2 writes a crossing box with west > east). Latitudes: the points, plus each edge's vertex where its azimuth passes 90° or 270°, found by bisection on the geodesic direct problem (Karney 2013). A polygon whose outline winds around a pole spans every longitude and reaches that pole
- Accuracy
- Edge extremes to 1e-9° or better; the box is the smallest in longitude span
- Notes
- 1 shown with the answer
- Cites
- Karney, C. F. F., Journal of Geodesy, Algorithms for geodesics; IETF RFC 7946, The GeoJSON Format
Something look off?
How we got thisFormula, worked example, sources, and proof
Model: Longitudes: every point, and for a line or polygon each geodesic edge's shorter arc of longitude, marked on the circle; the box is the complement of the largest gap (RFC 7946 §5.2 writes a crossing box with west > east). Latitudes: the points, plus each edge's vertex where its azimuth passes 90° or 270°, found by bisection on the geodesic direct problem (Karney 2013). A polygon whose outline winds around a pole spans every longitude and reaches that pole
Accuracy: Edge extremes to 1e-9° or better; the box is the smallest in longitude span
When to use this: Use this to get the extent of something — the area a set of points covers, the window a map should open at, the bounds to index a shape by, the box to hand to a tile or data service. Two things make it more than taking the minimum and maximum of the coordinates, and both matter: a line or polygon is bounded by its geodesic edges rather than its corners, and those bow poleward, sometimes by degrees; and a shape either side of the antimeridian has to produce the short box across it rather than one wrapping the whole world.
Limitations: The box is in latitude and longitude, so it is a region on the graticule and not a rectangle on the ground: it is widest in kilometres at its equatorward edge and its corners are not equidistant from anything. Treating a set of points as points rather than as a line or polygon is a different question and gives a different answer — the edges are only bounded when you say there are edges. Where a shape spreads so widely that no gap in longitude is clearly the largest, two correct implementations of the rule can return different boxes of the same width, so the tie is not something to depend on. A polygon whose outline winds around a pole spans every longitude and reaches that pole, which is right but is a very large box.
Worked example: Two points either side of the antimeridian. Source: RFC 7946 §5.2 writes a box crossing the antimeridian with west > east, so 170 to -170 is the 20° box and not the 340° one. Checked over ten shapes against Karney's geographiclib bisected for where each edge's azimuth passes due east or west, which agrees with the tool exactly in every coordinate. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.
You enter
- Points
- -17, 170 -15, -170
You get
- West
- 170°
- South
- -17°
- East
- -170°
- North
- -15°
- Longitude span
- 20°
- Crosses the antimeridian
- yes
- Pole enclosed
- none
Review: Not yet independently reviewed by a GIS professional.
Last verified: 2026-09-18, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.
Status: version 1.0.0, core 0.1.0. See this tool in the verification report.
Checked against: 22 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.
Sources
- Algorithms for geodesics, Karney, C. F. F., Journal of Geodesy, Vol. 87, No. 1. pp. 43-55 (direct and inverse problems; the vertex of a geodesic, where its azimuth is 90°).
- The GeoJSON Format, IETF RFC 7946, RFC 7946. Section 5.2 (the antimeridian: a bounding box with west greater than east).