POST /geometry/data
Validates a GeoJSON geometry and returns calculated site data: area, centroid, and a BNG WKT string suitable for placing orders.
Base URL: https://geoapi.geocerta.io
Sandbox URL: https://geoapi-staging.geocerta.io
Authentication required. Include your API key in the
api-keyheader. See Authentication.
Endpoint
POST /geometry/data
Content-Type: application/json
Request Body
The request body is a GeoJSON geometry object in WGS84 (EPSG:4326).
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | GeoJSON geometry type. One of Point, Polygon, MultiPolygon. |
coordinates | array | Yes | GeoJSON coordinates in WGS84 (longitude, latitude order). |
Response
200 OK — returns a result object. Check is_valid before using the other fields.
Invalid geometry
Returned when the geometry cannot be parsed, is not a closed polygon, or contains self-intersections.
Valid geometry
Response Fields
| Field | Type | Description |
|---|---|---|
is_valid | boolean | Whether the geometry is valid. |
area_sq_meters | number | Site area in square metres. 0 for points. |
x | number | Centroid Easting (British National Grid). |
y | number | Centroid Northing (British National Grid). |
centroid | GeoJSON Point | Centroid in WGS84 ([longitude, latitude]). |
wkt | string | Site geometry as a WKT string in British National Grid (BNG). Pass this to POST /orders. |
geometry | GeoJSON geometry | The input geometry (WGS84). |
Errors
| Status | Message | Cause |
|---|---|---|
400 | Bad Request | type is missing or not a supported geometry type, or coordinates is missing |
401 | Unauthorized | Missing or invalid API key |
Example
curl -X POST https://geoapi.geocerta.io/geometry/data \
-H "Content-Type: application/json" \
-H "api-key: YOUR_API_KEY" \
-d '{
"type": "Polygon",
"coordinates": [
[
[-0.1280, 51.5030],
[-0.1270, 51.5030],
[-0.1270, 51.5036],
[-0.1280, 51.5036],
[-0.1280, 51.5030]
]
]
}'