A bounding box is the simplest, most useful spatial primitive in any mapping stack. It is four numbers that describe a rectangle in latitude and longitude space, and it shows up in almost every API call, GeoJSON file, and map library you will ever use.
This guide explains what a bounding box is, the format conventions you need to know, the production patterns where it earns its keep, and the gotchas that catch every developer at least once.
The Definition
A bounding box (bbox) is the smallest axis-aligned rectangle that contains a feature or a set of points. "Axis-aligned" means its sides run along the latitude and longitude axes; the rectangle is not rotated. The bbox is described by four numbers: the western longitude, the southern latitude, the eastern longitude, and the northern latitude.
For Paris, the official municipal bbox is roughly [2.224, 48.8156, 2.4699, 48.9022]. For mainland France it is roughly [-5.142, 41.333, 9.560, 51.089]. For the entire planet it is [-180, -90, 180, 90].
A bbox is always two opposite corners. It cannot describe a non-rectangular shape, but it can describe the rectangle that wraps any shape, which is enough for fast spatial filtering.
The Format Question
The format conventions for bbox are inconsistent across systems, and the inconsistency is the source of most bbox bugs.
GeoJSON, OGC standards, and most modern APIs: [west, south, east, north], equivalently [minLng, minLat, maxLng, maxLat]. Longitude first, latitude second, both in WGS84.
Some web mapping libraries (Leaflet, Mapbox GL bounds objects): a LatLngBounds object with _southWest and _northEast corners. Lat first, then lng.
Many older APIs and CSV exports: [south, west, north, east] (lat first). Read the spec.
Tile services and WMS: bbox in the projection's units (Web Mercator metres, not lat/lng) when the tile is in EPSG:3857.
The defensive rule: never use a bare 4-element array in your own code. Wrap it in a typed object with named fields ({ west, south, east, north }) so the order is explicit. Convert at API boundaries.
Where Bounding Boxes Earn Their Keep
A bbox is the fastest possible spatial filter. Three classic uses:
Fitting a map to a feature. When the user lands on a search result, you call map.fitBounds(bbox) and the map zooms and pans to show the feature with appropriate padding. Every modern map library has this primitive.
Filtering API queries by area. Database engines and search APIs index bboxes very efficiently. A query like "show me all the places in this viewport" sends the visible bbox to the server, which uses a spatial index to return only the matching records. This is the foundation of viewport-based search.
Biasing autocomplete and geocoding. Pass the user's current map bbox as a viewport bias. The geocoder weights results inside the bbox more heavily, so typing "Liberty" inside the New York viewport returns the Statue of Liberty before any other Liberty in the world.
A fourth, less obvious use: bboxes are the bookkeeping unit of a vector tile system. Each tile covers a known bbox at a known zoom, and the renderer composites them into the visible map.
What an API Returns
Most geocoding APIs return a bbox alongside every match, because it tells you both the size of the matched feature (a country bbox is huge, a building bbox is tiny) and how to fit the map. A geocoding response for "France" returns a national-scale bbox; a response for "10 Downing Street" returns a building-scale bbox.
You can use the size of the returned bbox as a sanity check on precision. A query that matches at "country" precision but returns a building-sized bbox is suspicious. A query that matches at "rooftop" precision but returns a city-sized bbox is broken.
Bounding Boxes That Cross the Antimeridian
A subtle gotcha: a bbox that crosses the 180-degree antimeridian (e.g. for Russia, the Pacific, Fiji) cannot be described as west < east because it wraps around. Conventions vary:
- Some systems split such a bbox into two pieces, one for each side of the antimeridian.
- Some systems allow
west > eastand interpret it as "wrap around". - GeoJSON allows wrap-around but recommends splitting for interoperability.
For most European or single-country use cases this never comes up. If you build a global product (airline routes, shipping, fisheries), test the antimeridian case explicitly.
Bounding Boxes vs Polygons
A bbox is a rectangle. A real feature is rarely rectangular. The bbox of France includes parts of the Atlantic Ocean and Spain. The bbox of Manhattan includes parts of New Jersey and Queens.
When the rectangle approximation is good enough (fitting a map, fast pre-filtering), bbox is the right tool. When you need to know whether a point is actually inside the feature, you need point-in-polygon math against the real boundary geometry. A common production pattern: filter by bbox first (fast, indexable, eliminates 99% of records), then run point-in-polygon on the survivors (slow but accurate). This two-stage approach is how most spatial databases work under the hood.
Bounding Boxes in Computer Vision
You may see "oriented bounding box" mentioned in object detection, robotics, or 3D rendering. That is a different concept: an OBB is rotated to fit a feature more tightly than an axis-aligned box would. In geospatial work, axis-aligned bboxes are the standard because they index cleanly, slot into the tile grid, and are trivial to test for overlap. Oriented bboxes appear when you need rotated-rectangle math, which is rare in mapping but common in computer vision.
How MapAtlas Uses Bounding Boxes
Every result from the Geocoding API and Search API returns a bbox field with the matched feature's extent in WGS84 longitude/latitude order, exactly the format GeoJSON and modern map libraries expect. You can pass a boundary.rect.* parameter to bias geocoding to a viewport, and the Isochrone API returns its travel-time polygons with a wrapping bbox so you can fit a map without computing it yourself.
For a hands-on intro to GeoJSON and how bboxes fit into the larger spatial data picture, see What Is GeoJSON and What Is a Geocode.
Frequently Asked Questions
What is a bounding box?
A bounding box (often shortened to bbox) is the smallest axis-aligned rectangle that contains a geographic feature or a set of points. It is described by four numbers: the minimum and maximum longitude and the minimum and maximum latitude. Bounding boxes are used everywhere in mapping: to fit a map to a feature, to filter database queries by area, to define the extent of a tile, and to bias geocoding results to a region. They are the simplest, fastest spatial primitive in production code.
What is the standard format for a bounding box?
GeoJSON and most modern APIs use the order [west, south, east, north], also written as [minLng, minLat, maxLng, maxLat]. This is the format you should default to. Some older APIs and CSV exports use [south, west, north, east] (i.e. lat first), and a few use four separate fields. Always check the docs of the specific API or format. The single most common mistake is mixing lat/lng order, which puts the box on the wrong side of the planet.
What is the difference between a bounding box and an oriented bounding box?
A regular bounding box is axis-aligned: its sides run along the latitude and longitude axes. An oriented bounding box (OBB, common in computer vision and game engines) is rotated to fit the feature more tightly, which gives a smaller area but more complex math. In geospatial work, axis-aligned bboxes are the standard because they index cleanly into spatial databases, slot into the tile grid, and are trivially testable for overlap. Oriented bounding boxes appear in 3D rendering, object detection, and physics engines.
How do I use a bounding box to filter a geocoding API?
Pass the bbox as a viewport bias parameter. In the MapAtlas Geocoding API you send `boundary.rect.min_lon`, `boundary.rect.min_lat`, `boundary.rect.max_lon`, `boundary.rect.max_lat`, and the geocoder ranks results inside that area higher than results outside. This is essential for autocomplete inside a map: as the user pans, you update the bbox so suggestions match what they are looking at. Without a bbox bias, an autocomplete for 'Springfield' returns whichever Springfield has the highest global popularity, which is rarely what the user means.

