API and Viewer
API Endpoints
POST /actualiser
Returns the detailed BRDR output as GeoJSON feature collections.
Query parameter:
result_mode=predictions(default): evaluated predictions outputresult_mode=all: full process steps output
Request body (shape):
{
"featurecollection": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "2",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [[[0,0],[1,0],[1,1],[0,1],[0,0]]]
}
}
]
},
"params": {
"crs": "EPSG:31370",
"grb_type": "GRB - ADP - administratief perceel",
"full_reference_strategy": "prefer_full_reference",
"od_strategy": "SNAP_ALL_SIDE",
"snap_strategy": "PREFER_VERTICES",
"max_relevant_distance": 6.0,
"processor": "AlignerGeometryProcessor"
}
}Notes:
geometry.typecan bePoint,LineString,Polygonand multi-variants.max_relevant_distanceis limited to25.
POST /actualiser/viewer
Returns a viewer-oriented structure:
{
"series": {
"0.0": {
"result": { "type": "Polygon", "coordinates": [] },
"result_diff_min": { "type": "Polygon", "coordinates": [] },
"result_diff_plus": { "type": "Polygon", "coordinates": [] }
}
},
"diffs": {
"0.0": 0.0
},
"diff_metric": "area",
"predictions": {
"0.0": false
},
"prediction_scores": {
"0.0": 0.0
}
}Optional query parameter:
feature_idwhen request contains multiple featuresresult_mode=all(default) orresult_mode=predictions
Status Codes
200: Success400: Validation or request-shape issue503: Upstream GRB service unavailable500: Unexpected internal error
Viewer Integration
The viewer:
- keeps an input geometry in local state
- sends that geometry to
/actualiser/viewer - updates timeline and map layers from returned
seriesanddiffs - highlights prediction steps and can jump to previous/next prediction quickly
Main frontend files:
src/api/brdrApi.tssrc/state/useBrdrState.tssrc/components/map/MapView.tsx
Testing the API with curl
With body.json in repository root:
curl -X POST "http://127.0.0.1:80/actualiser/viewer?feature_id=2" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d @body.json