How to Calculate a GeoJSON Bounding Box
Find the extent of GeoJSON locations, routes or regional datasets for maps and software workflows, without confusing a box with a service area.
Try it now: Geographic bounding box calculator
What is a bounding box?
A bounding box is a rectangular geographic area defined by its minimum and maximum coordinate values. It describes the geographic extent of a point, line, polygon or collection of geographic features.
Bounding boxes are commonly used in GIS applications, web mapping, spatial databases and geographic APIs. They provide a simple way to describe the area covered by a geographic dataset without examining every individual feature.
Software teams can use an extent to set a map view, narrow a regional data check or pass a bounding box to another service that accepts one. For delivery zones and service areas, remember that the rectangle is an approximation around the data, not the zone boundary itself.
For geographic coordinates, a bounding box is normally defined using four values:
- Minimum longitude (western boundary).
- Minimum latitude (southern boundary).
- Maximum longitude (eastern boundary).
- Maximum latitude (northern boundary).
You can calculate the bounding box of your data using the BBox calculator.
Coordinate order
Coordinate order is important when calculating a bounding box. GeoJSON uses longitude first and latitude second.
A two-dimensional GeoJSON bounding box follows this order:
[
minimum longitude,
minimum latitude,
maximum longitude,
maximum latitude
]
This means that a bounding box around Copenhagen might look like:
[
12.50,
55.60,
12.70,
55.80
]
The values represent the western, southern, eastern and northern boundaries respectively.
Worked example
Consider a GeoJSON dataset containing the following four points:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": { "name": "Point A" },
"geometry": {
"type": "Point",
"coordinates": [12.50, 55.60]
}
},
{
"type": "Feature",
"properties": { "name": "Point B" },
"geometry": {
"type": "Point",
"coordinates": [12.70, 55.80]
}
},
{
"type": "Feature",
"properties": { "name": "Point C" },
"geometry": {
"type": "Point",
"coordinates": [12.60, 55.75]
}
},
{
"type": "Feature",
"properties": { "name": "Point D" },
"geometry": {
"type": "Point",
"coordinates": [12.55, 55.65]
}
}
]
}
To calculate the bounding box, find the minimum and maximum values for each coordinate dimension.
| Value | Result |
|---|---|
| Minimum longitude | 12.50 |
| Minimum latitude | 55.60 |
| Maximum longitude | 12.70 |
| Maximum latitude | 55.80 |
The resulting bounding box is:
[12.50, 55.60, 12.70, 55.80]
Step-by-step calculation
- Open the BBox calculator.
- Prepare your geographic data or coordinates.
- Provide the input using the calculator's supported input format.
- Calculate the bounding box.
- Review the minimum and maximum longitude and latitude values.
- Copy or download the resulting bounding box for use in your application.
You can also inspect your source data in the GeoJSON viewer to understand which features determine the geographic extent.
Common uses
Bounding boxes are useful in many different geospatial workflows.
- Map initialization: Set the initial map extent so that all relevant features are visible.
- Spatial filtering: Retrieve features that intersect a geographic area.
- API requests: Pass a geographic extent to APIs that support bounding-box queries.
- Data validation: Check whether geographic features extend beyond an expected area.
- Transport planning: Define the geographic extent of a delivery region, road network or operational area.
- Data management: Store the approximate geographic coverage of datasets for indexing and discovery.
A bounding box is a rectangular approximation of geographic coverage. It does not describe the exact shape of the underlying features. For example, a bounding box around a curved road also includes the empty space surrounding that road.
Common errors
- Reversed coordinate order. GeoJSON uses longitude first and latitude second. Mixing the two produces incorrect extents.
- Using projected coordinates. Easting and northing values from UTM cannot be interpreted directly as longitude and latitude.
- Ignoring nested geometries. A FeatureCollection can contain many features and geometry types. The bounding box must include all relevant coordinates.
- Confusing a bounding box with a polygon. Four bounding-box values describe an extent, not necessarily a geographic feature boundary.
- Crossing the antimeridian. Geographic datasets spanning the 180-degree meridian require special consideration because the smallest geographic extent may not correspond to the ordinary minimum and maximum longitude values.
If you need to inspect the features used in your calculation, open the dataset in the GeoJSON viewer.
The API can calculate a bounding box from a GeoJSON FeatureCollection for application workflows. See the API overview and API documentation for the required request format. You can also view the source GeoJSON on a map before using its extent.