How to Find the Overlapping Area Between Polygons

API or service
Geometry Operations API
Task
Two or more polygons → shared area
Examples
URL
Difficulty
Beginner
Time
7 min

Find the overlapping area between polygons

You have two or more territories, restrictions, properties, or service areas and need the exact geometry shared by all of them. Use the Geometry Operations API intersection operation.

Task flow: overlapping polygons → intersection → shared Polygon or MultiPolygon.

The result can be rendered directly or sent to the area operation for measurement. This is different from the boolean intersects operation: intersects only answers whether geometries share any space, while intersection constructs the shared geometry.

Intersect the polygons

The request uses the same two Berlin rectangles as the merge example:

POST https://api.geoapify.com/v1/geometry/operation?apiKey=YOUR_API_KEY
Content-Type: application/json
{
  "operation": "intersection",
  "polygons": [
    {
      "type": "Polygon",
      "coordinates": [[
        [13.38, 52.50], [13.42, 52.50],
        [13.42, 52.54], [13.38, 52.54],
        [13.38, 52.50]
      ]]
    },
    {
      "type": "Polygon",
      "coordinates": [[
        [13.40, 52.51], [13.44, 52.51],
        [13.44, 52.55], [13.40, 52.55],
        [13.40, 52.51]
      ]]
    }
  ]
}

The shared area is the smaller rectangle from longitude 13.40–13.42 and latitude 52.51–52.54:

{
  "type": "geojson",
  "data": {
    "type": "Feature",
    "properties": {},
    "geometry": {
      "type": "Polygon",
      "coordinates": [[
        [13.40, 52.51], [13.42, 52.51],
        [13.42, 52.54], [13.40, 52.54],
        [13.40, 52.51]
      ]]
    }
  }
}

When the inputs share no area, handle an empty result rather than assuming data.geometry exists. Touching only at an edge or point also may not produce an area polygon suitable for area measurement.