ForHosting KIT · Developer Utilities

Polygon bounding box calculator

A polygon bounding box is the smallest axis-aligned latitude and longitude rectangle that contains every supplied vertex.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

This calculator scans your polygon coordinates and returns the southwest-style minimum corner and northeast-style maximum corner without calling a map service. It is useful for map viewport setup, spatial filtering, indexing, validation, and quick geographic summaries. The calculation is deterministic, accepts ordinary decimal-degree coordinates, and uses the same logic in the browser and through the API.

Prepare the polygon vertices

Provide at least three vertices, with each vertex represented by a lat and lon number in decimal degrees. Latitude must fall between -90 and 90, while longitude must fall between -180 and 180. The points may describe a convex polygon, a concave polygon, or even a ring whose first point is repeated at the end. Unlike an area or centroid calculation, bounding-box calculation does not depend on winding direction and does not need the vertices to arrive clockwise or counterclockwise. Every supplied point contributes independently to the extrema. The capability still requires three points because its input represents a polygon rather than an arbitrary point collection. Use numbers rather than formatted coordinate strings, degree symbols, cardinal-direction suffixes, or comma-separated text. Invalid records, missing coordinates, non-finite values, and out-of-range geographic coordinates are rejected clearly instead of being coerced. A request can contain up to 10,000 vertices, which keeps execution predictable while covering detailed boundaries used in typical application workflows.

Understand the returned corners

The result contains min_corner and max_corner. The minimum corner combines the smallest latitude found anywhere in the list with the smallest longitude; the maximum corner combines the largest latitude with the largest longitude. These corners describe an axis-aligned rectangle in the latitude-longitude coordinate plane. They are not necessarily vertices of the original polygon, because the lowest latitude and lowest longitude may occur at different points. No padding, projection, rounding, or geodesic expansion is applied, so values in the response preserve the numeric extrema supplied by the caller. Longitude is treated literally within the conventional -180 to 180 range. Consequently, a polygon that crosses the antimeridian can produce a numerically wide box, such as one extending from -179 to 179 degrees. That behavior is intentional and explicit: it reports ordinary minimum and maximum longitude rather than choosing a wrapped map viewport. If your application uses wrapped longitudes, it can compare alternative antimeridian-aware spans after receiving these direct bounds.

Use the bounds in mapping and data pipelines

Bounding boxes are compact summaries, so they fit naturally at the start of many spatial workflows. A map interface can use the two corners to choose an initial viewport. A database import can store the four extrema beside a polygon and use them for a fast first-pass overlap test before running a more expensive point-in-polygon or geometry intersection operation. Validation code can compare expected service regions with submitted shapes, while analytics jobs can group boundaries by broad geographic extent. Remember that the box contains the polygon but does not reproduce its shape: points inside the rectangle may still lie outside a concave polygon, and overlapping boxes do not prove that two polygons intersect. The calculation also works directly in latitude and longitude rather than a projected coordinate reference system. That makes it ideal for coordinate envelopes and map navigation, but widths expressed in degrees are not constant physical distances across latitudes. Run it free in the browser for individual checks, or automate repeatable requests through the API for $0.002 per item.

Fit a map viewport

Turn polygon vertices into minimum and maximum corners that a map client can use to frame the full boundary.

Prefilter spatial records

Store simple extrema for inexpensive candidate filtering before applying exact polygon intersection tests.

Validate geographic coverage

Compare a submitted boundary's overall extent with permitted latitude and longitude ranges in an import pipeline.

What does the calculation cost?

The API price is $0.002 per item, and the browser calculator is free to use on this page.

Does vertex order matter?

No. The calculation independently finds the minimum and maximum latitude and longitude among all vertices.

Must I repeat the first vertex at the end?

No. Both open and explicitly closed vertex lists produce the same bounds when their coordinate extrema are identical.

How are antimeridian-crossing polygons handled?

Longitude uses literal numeric extrema from -180 to 180, so a crossing polygon may return a wide box rather than a wrapped one.

Is this an exact polygon containment test?

No. The returned rectangle contains all polygon vertices, but a point inside that rectangle may still be outside the polygon.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geo/polygon-bounding-box

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geo/polygon-bounding-box \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"vertices":[{"lat":40.7128,"lon":-74.006},{"lat":34.0522,"lon":-118.2437},{"lat":41.8781,"lon":-87.6298}]}'
{
  "vertices": [
    {
      "lat": 40.7128,
      "lon": -74.006
    },
    {
      "lat": 34.0522,
      "lon": -118.2437
    },
    {
      "lat": 41.8781,
      "lon": -87.6298
    }
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.polygon_bounding_box",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_items10000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →