API and Viewer

API Endpoints

POST /actualiser

Returns the detailed BRDR output as GeoJSON feature collections.

Query parameter:

  • result_mode=predictions (default): evaluated predictions output
  • result_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.type can be Point, LineString, Polygon and multi-variants.
  • max_relevant_distance is limited to 25.

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_id when request contains multiple features
  • result_mode=all (default) or result_mode=predictions

Status Codes

  • 200: Success
  • 400: Validation or request-shape issue
  • 503: Upstream GRB service unavailable
  • 500: Unexpected internal error

Viewer Integration

The viewer:

  1. keeps an input geometry in local state
  2. sends that geometry to /actualiser/viewer
  3. updates timeline and map layers from returned series and diffs
  4. highlights prediction steps and can jump to previous/next prediction quickly

Main frontend files:

  • src/api/brdrApi.ts
  • src/state/useBrdrState.ts
  • src/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