Building volume statistics inside an arbitrary drawn polygon
The polygon counterpart of /res_api/bldg_vol_bbox: instead of a circular buffer it evaluates the ACTUAL polygon in PostGIS, so the count matches exactly what the user drew. A building belongs to the polygon when its footprint CENTROID (building_footprint_rf.geom) is inside - no double counting across neighbouring polygons, no boundary bleed. Volumes are rf_volume_lod22 (roofer LoD2.2).
The outer ring is closed automatically, must have ≥ 3 distinct vertices and ≤ 10,000, and its geodesic area is gated to 2,500..250,000 m² (mirroring the footprint client's drawing limits) by a cheap area-only query BEFORE the footprint count runs. The response mirrors /bldg_vol_bbox field-for-field so density clients render it unchanged; density.bbox_area_m2 is the polygon's own area.
Auth quirk inherited from /bldg_vol_bbox: a MISSING token header is a 400, a WRONG one is a 401 (not 401/403). Real status codes, JSON bodies, no X-RES-API-Version needed. Not cached.
https://res.aireon.ch/res_api/bldg_vol_polygonAuthorization
Request body JSON required
Example requests
{
"polygon": {
"type": "Polygon",
"coordinates": [
[
[
8.54,
47.376
],
[
8.545,
47.376
],
[
8.545,
47.379
],
[
8.54,
47.379
],
[
8.54,
47.376
]
]
]
}
}{
"ring": [
[
8.54,
47.376
],
[
8.545,
47.376
],
[
8.545,
47.379
],
[
8.54,
47.379
]
]
}Returns
200
Building volume statistics for the polygon.