Skip to content

feat(grb): road-crossings level evidence with a coverage polygon - #501

Merged
imagodata merged 2 commits into
mainfrom
feat/road-crossings-artifact
Oct 1, 2026
Merged

imagodata merged 2 commits into
mainfrom
feat/road-crossings-artifact

Conversation

@imagodata

@imagodata imagodata commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

What

prepare_grb now publishes a road-crossings level-evidence artifact for Flanders, for MILOU's confirmed-forage costing (contract: MILOU docs/runbooks/surface-regional-priority.md § « Traversées confirmées : contrat de preuve »):

file content
road_crossings.geoparquet one row per road unit, EPSG:31370: footprint (Polygon/MultiPolygon), second geometry column axis (LineString/MultiLineString), road_id, structure ∈ {ground, grade_separated, unknown}, complex_crossing, provenance (structure_evidence, source, source_layer, source_ids, axis_ids, morf_codes)
road_crossings_coverage.geoparquet one polygon: where the artifact is complete
road_crossings_exclusions.geoparquet every area left out of coverage, with its reason

New capability: src/gispulse/capabilities/vector/grb_road_crossings.py (build_grb_road_crossings). The rules are summarised below; the plugin README has the details and citations.

Base: main. This PR was planned as stacked on #496 (feat/regional-road-surfaces); #496 is now squash-merged, so the branch was rebased onto origin/main (git rebase --onto origin/main 3ec07bf).

  • ground comes only from WBN elements. The objectenhandboek captures as wegbaan only "de aan het maaiveld zichtbare wegcorridor": there is no Wbn on a bridge, under a bridge or in a tunnel. It is never assigned by default.
    • The footprint is the whole WBN corridor, not the carriageway alone.
    • Fragments of one carriageway share a road_id: touching wegsegment elements that carry the same carriageway axis and the same category.
    • These are never merged: kruispuntzones, elements holding an axis end that is not a plain pass-through node (a junction or a dead end), and undocumented TYPEs.
  • grade_separated needs carriageway axes crossing without a node inside a group of KNW 1/12 polygons, with every such axis taking part and none ending inside.
    • The rule rests on two official facts: a Wegknoop is defined as what describes connectivity, and the KNW polygon is the structure. It is an inference, not a rule the source states.
    • Measured on a Gand sample: 91 of 101 node-less crossings fall inside KNW 1/12.
  • unknown: every other structure carrying a carriageway (single axis, axis ending inside, axis crossing nothing). These are always left out of coverage.
  • Coverage also excludes:
    • units carrying an unresolved axis (MORF 120, 125, −8, not in service);
    • footprints leaving the bbox;
    • a crossing_exclusion_buffer_m (default 15 m) around drivable axes that no unit accounts for;
    • node-less crossings or self-crossings outside structures.
  • complex_crossing = MORF 101 autosnelweg, configurable.

Validation

  • Unit tests: 47 new capability tests plus 2 new bundle tests, and an existing bundle test extended.
    • Geometry cases covered: tangent axis, collinear axis on a shared edge, axes cut at a crossroads, degree-2 join, fragment grouping.
    • Also covered: no implicit ground, structure verdicts, no spatial duplicate, coverage exclusions, GeoParquet round trip with both CRS, dedicated error codes.
  • tests/unit/ with the CI extras: 6 483 passed. The 8 failures are in test_step_kinds, test_run_control and test_run_events. The step_kinds ones and the run_control cancel case reproduce on origin/main with the same extras; none touches the GRB.
  • Live on three Flemish bboxes (Gand, near Oudenaarde, near Leuven): 1.4–2.0 s each, 91–96 % coverage, no footprint overlap, every axis simple. The artifacts load in MILOU's real load_road_crossings.
  • Three adversarial reviews (opus-reviewer). Findings fixed:
    • quadratic cost;
    • unresolved axes left inside coverage;
    • bbox-edge verdicts;
    • fragment road_ids;
    • over-merging at junctions not mapped as kruispuntzones and at dead-end streets;
    • a silent TYPE drift;
    • aardeweg;
    • uncovered on-boundary axes;
    • self-crossings.

Consumer findings (MILOU side, not fixed here)

I ran MILOU's real RoadCrossings.crossings on 25 tracés of the 12/09 canon run (32.8 km) against these artifacts. Two problems sit in the consumer, independently of this producer:

  1. Longitudinal "crossings". The tracés are drawn on the OSM axes, so they run inside the road corridor they follow. Every micro side change across that road's own axis counts as a crossing, and the whole run inside the footprint is billed as forage. Result: 36 longitudinal crossings for 7.35 km, up to 922 m in one piece, against 46 genuine transversal crossings for 3.2 km.
  2. ROAD_CROSSING_INCOMPLETE. 10 of the 25 tracés end inside a road footprint, which makes the whole tracé fail.

On top of that, MILOU rejects an empty artifact (frame.empty), and the coverage polygon is not read yet (D6, mixed mode).

Open decisions

  • Up/down is not resolved. grade_separated holds for an excavation following one of the crossing roads through the structure. An excavation dug at ground level under a deck, off any mapped road, is not represented.
  • 120 dienstweg and 125 aardeweg are unresolved, so they become coverage holes. Treating them as carriageway or as non-carriageway is a decision for MILOU.
  • The exclusion buffer default (15 m) has no source basis.
  • road_id is stable for one acquisition only. Bundles from different bounds must be deduplicated on source_ids, never concatenated.
  • Wallonia and Brussels are not covered. That waits for D5.

Refs #464

🤖 Generated with Claude Code

sducournau and others added 2 commits October 1, 2026 13:14
prepare_grb now also writes road_crossings.geoparquet (EPSG:31370, footprint
plus a second `axis` geometry column, road_id, structure in ground /
grade_separated / unknown, complex_crossing, provenance),
road_crossings_coverage.geoparquet and road_crossings_exclusions.geoparquet,
for MILOU's confirmed-forage contract.

- ground only from WBN elements: the objectenhandboek captures as wegbaan
  only the corridor visible at ground level (none on, under or through a
  bridge, nor in a tunnel). Fragments of one carriageway share a road_id;
  kruispuntzones, elements holding a junction node and undocumented TYPEs
  are never merged.
- grade_separated only when carriageway axes cross without a node inside a
  touching KNW 1/12 group, every axis takes part and none ends inside;
  every other structure carrying a carriageway is unknown.
- coverage excludes unknown footprints, unresolved axes (MORF 120, 125, -8,
  not in service), footprints leaving the bbox, and a buffer around
  drivable axis length no unit accounts for and node-less crossings
  outside structures.
- complex_crossing from MORF 101 autosnelweg, configurable.

Validated on three Flemish bboxes (1.8-2.5 s each, 91-96 % coverage, no
footprint overlap, simple axes) and loaded by MILOU's load_road_crossings.

Signed-off-by: sducournau <simon@imago.dev>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A street ending inside a neighbouring corridor shared its axis stub with
that element, so the two distinct streets were merged into one road_id and
a trench crossing the main road then running up the side street was bored
over the united footprint (107 m instead of 16 m on a real Oudenaarde case,
Westerring + Kraneveld). Only a plain pass-through node, where exactly two
axis ends meet, now lets an element be merged as a fragment; junctions
(three or more ends) and dead ends (one) stop it.

Also corrects the README and CHANGELOG wording on merged street names and
on unresolved axes inside a ground element (only a buffer is excluded).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: sducournau <simon@imago.dev>
@imagodata
imagodata merged commit 2057e07 into main Oct 1, 2026
9 of 11 checks passed
@imagodata
imagodata deleted the feat/road-crossings-artifact branch October 1, 2026 11:30
imagodata pushed a commit that referenced this pull request Oct 1, 2026
Bump gispulse to 2.5.0 (pyproject, QGIS plugin metadata, uv.lock, which
had stayed at 2.3.0). Promote the changelog for #496 (PICC/UrbIS/GRB road
layers, counted pagination core, GRB face classification), #501 (GRB
road-crossings level evidence) and #499 (read_pbf_roads), mirrored into
docs-site FR and EN.

The PICC, UrbIS and GRB plugins import the counted pagination core that
first ships in 2.5.0, so their dependency floor is raised to
gispulse>=2.5.0 and their READMEs no longer point at integration/v2.4.

Capability count unchanged (144): the new GRB functions, including
build_grb_road_crossings, are not registered capabilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: sducournau <simon@imago.dev>
@imagodata imagodata mentioned this pull request Oct 1, 2026
imagodata added a commit that referenced this pull request Oct 1, 2026
Bump gispulse to 2.5.0 (pyproject, QGIS plugin metadata, uv.lock, which
had stayed at 2.3.0). Promote the changelog for #496 (PICC/UrbIS/GRB road
layers, counted pagination core, GRB face classification), #501 (GRB
road-crossings level evidence) and #499 (read_pbf_roads), mirrored into
docs-site FR and EN.

The PICC, UrbIS and GRB plugins import the counted pagination core that
first ships in 2.5.0, so their dependency floor is raised to
gispulse>=2.5.0 and their READMEs no longer point at integration/v2.4.

Capability count unchanged (144): the new GRB functions, including
build_grb_road_crossings, are not registered capabilities.

Signed-off-by: sducournau <simon@imago.dev>
Co-authored-by: sducournau <simon@imago.dev>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant