How to Create a Buffer Around a Point, Line, or Polygon
- API or service
- Geometry Operations API
- Task
- Geometry + distance → buffer polygon
- Examples
- Difficulty
- Beginner
- Time
- 7 min
Create a buffer around a point, line, or polygon
You have a GeoJSON geometry and need an area within a specified physical distance of it. The Geometry Operations API buffer operation creates a Polygon or MultiPolygon around points, routes, boundaries, or existing areas.
Task flow: geometry + distance + unit → buffer polygon.
Buffers work well for proximity searches, safety corridors, notification zones, and rough exclusions. They describe geometric distance, not travel time or road access. Use the Isoline API when the boundary must represent what is reachable through a transport network.
Choose distance, units, and smoothness
The request requires geometry and distance. Put the distance unit and curve resolution inside params:
| Parameter | Purpose |
|---|---|
distance |
Buffer radius in the selected unit. |
params.units |
Use an explicit physical unit such as meters, kilometers, miles, or feet. |
params.steps |
Controls how many positions approximate curved corners. Higher values look smoother but produce larger GeoJSON. |
Use explicit units even when a default exists so the stored request remains unambiguous. For points, steps=16 produces a smooth 64-segment approximation with 65 positions including the repeated closing position.
Buffer the original geometry when correctness matters. Buffering an already simplified line or polygon can move the resulting boundary noticeably.
Create a 500-meter point buffer
This request creates a 500-meter polygon around a point in Berlin. The point uses [longitude, latitude] order.
POST https://api.geoapify.com/v1/geometry/operation?apiKey=YOUR_API_KEY
Content-Type: application/json
{
"operation": "buffer",
"geometry": {
"type": "Point",
"coordinates": [13.405, 52.52]
},
"distance": 500,
"params": {
"units": "meters",
"steps": 16
}
}
Reduced response: The 65 Polygon positions are omitted.
{
"type": "geojson",
"data": {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon"
}
}
}
Use the complete data.geometry coordinates returned by the API. Do not use the reduced response as valid GeoJSON.