feat: add semantic GIS selection metrics
This commit is contained in:
@@ -427,6 +427,42 @@ Response:
|
||||
"geojson": {
|
||||
"type": "FeatureCollection",
|
||||
"features": []
|
||||
},
|
||||
"summary": {
|
||||
"metric_label": "Wateroppervlakte",
|
||||
"metric_value": 5.25,
|
||||
"metric_unit": "ha",
|
||||
"aggregation_method": "intersection_area",
|
||||
"primary_metric_key": "water_area",
|
||||
"feature_count": 23,
|
||||
"is_estimate": false,
|
||||
"warning": "Watervolume is niet berekenbaar zonder betrouwbare diepte- of bathymetrische gegevens.",
|
||||
"metrics": [
|
||||
{
|
||||
"metric_key": "water_area",
|
||||
"metric_label": "Wateroppervlakte",
|
||||
"metric_value": 5.25,
|
||||
"metric_unit": "ha",
|
||||
"aggregation_method": "intersection_area",
|
||||
"is_estimate": false
|
||||
},
|
||||
{
|
||||
"metric_key": "watercourse_length",
|
||||
"metric_label": "Lengte waterlopen",
|
||||
"metric_value": 12.75,
|
||||
"metric_unit": "km",
|
||||
"aggregation_method": "intersection_length",
|
||||
"is_estimate": false
|
||||
},
|
||||
{
|
||||
"metric_key": "feature_count",
|
||||
"metric_label": "Waterobjecten",
|
||||
"metric_value": 23,
|
||||
"metric_unit": "objecten",
|
||||
"aggregation_method": "feature_count",
|
||||
"is_estimate": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -439,6 +475,9 @@ Rules:
|
||||
- `area_id` is optional and must belong to the route project. When present, the bbox remains the bounded preview extent but PostGIS filtering and configured aggregations use the persisted Area geometry exactly. This prevents a municipal or regional full-work-area query from counting objects in the surrounding bbox corners.
|
||||
- Results are generated from persisted PostGIS `vector_features`, not from client-side map data.
|
||||
- `feature_count` is the number of GeoJSON features returned in the bounded preview. `total_feature_count` is the exact number of persisted rows intersecting the requested bbox or persisted Area geometry.
|
||||
- `summary` keeps one backwards-compatible primary metric and exposes all relevant measurements in `metrics`. Known themes use metric PostGIS calculations: building/forest/water/parcel surfaces in hectares, road and watercourse lengths in kilometres, population in inhabitants and intersecting feature counts as supporting evidence.
|
||||
- Area and length calculations transform geometry to Belgian Lambert 72 (`EPSG:31370`); they are never calculated in geographic degrees.
|
||||
- Water volume is not inferred from 2D GRB geometry. It remains unavailable until a source provides reliable depth or bathymetry with compatible spatial coverage and provenance.
|
||||
- The response is capped by `limit` and returns `truncated=true` when `total_feature_count` exceeds the returned preview.
|
||||
- `limit` is bounded to `1..1000`. Municipality-scale clients must page spatially by viewport instead of requesting an unbounded municipality FeatureCollection.
|
||||
- The Map workspace uses this existing endpoint for vector datasets above 5,000 features. It starts delivery at zoom level 14, debounces `moveend` requests and explicitly reports `truncated=true` as a request to zoom further in. This is a client delivery policy, not a second API or persistence path.
|
||||
|
||||
Reference in New Issue
Block a user