Skip to content

TrailView features: a short bridge over a way loses its deck (the passage below is walled up) #3639

Closed

Description

@timohueser

Part of #3096. Related to #3484 (deck ends). Found by the owner in the plan view (ground=plan).

Fault

Where a short bridge crosses a way, the plan view can draw no deck. The way below then ends at a concrete wall, about 5 m high, across the passage. Where the way below has the higher rank, the fault shows the other way: the way below cuts a notch through the railway or the road on top.

The owner's view: lat=46.970405&lon=8.421964&heading=344.8&pitch=-33.3&alt=495.3 (a side road below the two carriageways of a motorway). The fault is on develop. The tunnel slices do not change it.

Pictures on the owner's PC: /media/timo/OSM1/tmp/ground-plan/tunnels/underbridge/pics/ (INDEX.md; clearest: r1/o1-eye.jpg, r1/o1-owner.jpg, r1/p3-rail-over-track.jpg). State and census: tunnels/underbridge/STATE.md.

Cause (in the bake)

  • The two carriageways cross the side road on bridge features 11.9 m and 11.7 m long (bridge=yes, layer=1), with 5.35 m and 5.04 m of room. The bake writes levels=O: each bridge becomes a ground way.
  • graph/levels.rs place_a puts each A line where the end line of the deck is clear of the arms at its end (Ctx::clear: the distance less the half-width of the arm). The arms include the straight continuation of the bridge way itself. Its stroke counts with a round end. Thus each A line moves in from each end by the half-width of the way (6 m for the motorway). The deck that remains is shorter than deck_min_m (2 m), and the way becomes ground.
  • The wall is a step slot of storey 0 between the side road (484.45 m) and the carriageway on the ground (489.3 m to 489.5 m). It is drawn as concrete because the stretch is a bridge feature on the ground (BRIDGE_GROUND).

Scope (test box B, census of graph::levels over all 9,108 cells)

  • 2,111 bridge features cross a way or water with room for a deck.
  • 74 get no deck: 12 over a way (8 places; motorway 4, trunk 2, rail 4, narrow gauge 1, tertiary 1, residential 1; lengths 2.9 m to 13.9 m) and 62 over streams.
  • 65 of the 74 have less than 2 m between the A lines. 8 have 2.2 m to 4.3 m between them but no sample point in that length, so no deck run. 1 has an A line past A_MAX_M.
  • A second group: 69 crossings (51 over a way) where the bridge keeps a deck, but the way below passes below the ground stub between the bridge end and the A line.

Rules (prototype counts from the census)

  1. Square end at the node. The paved stroke of an arm ends square at the node that it shares with the deck. A straight continuation then does not move the A line in; side arms still do. No deck: 74 → 4 (0 over a way). Stub crossings: 69 → 9. The A lines move on about 92 % of the deck ways (median 1.7 m out, 6 m at most), so most decks become longer.
  2. Keep the passage. An A line is never on the stroke of a way that passes below the deck with room for a deck. No deck: 74 → 2 (0 over a way). Stub crossings: 69 → 1. The A lines move on about 17 % of the deck ways (median 1.0 m).

Decision of the orchestrator: build rules 1 and 2 together. Rule 1 removes the cause, rule 2 guards the passage. The change is visible at most bridges, so the owner sees bridge pictures (before and after, many places, his flagged bridge views included) before the merge.

Work

  • The rules in graph/levels.rs, one focused test for each invariant.
  • A new features revision, a rebake of test box B for pictures, a rebake of the repo fixture. The off digests of cells with bridges change; list them.
  • The 62 short bridges over streams: check the result against the culvert look.
  • Before a production update: today's app before and after on the new data.

Separate fault seen at the same place, not traced: the motorway has no lane lines in the plan view along the full view (pics/r3/o1-along.jpg).

Requirements: none


Generated by Claude Code

Activity

  1. timohueser commented on Nov 19, 2026

    @timohueser
    OwnerAuthor

    This issue is item P0 of the epic #3651 (tunnel openings, underpasses and level crossing equipment as parts that the data bake places). The epic adds one thing to the rules here, and states one fact for the work:

    • No lower limit for the length of a deck. With rules 1 and 2, a bridge that keeps a passage is a deck however short it is. deck_min_m does not turn a bridge over a way or water into a ground way.
    • Today's app does not change. Only the ground plan (ground=plan) reads the tag levels, so the new revision of the feature tiles changes nothing that today's app draws. The pictures before | after are of the new roads; the rule of the epic for a production update stays (today's app pictured before and after on the new tiles at bridges).

    P0 does not depend on the other items of the epic and can merge at any time.


    Generated by Claude Code

  2. timohueser commented on Nov 19, 2026

    @timohueser
    OwnerAuthor

    P0: the algorithm and its invariants (before the code)

    Branch claude/trailview-3639-bridge-passage, from origin/develop. All changes are in host/obc-ground-plan/src/graph/levels.rs.

    Words. A passage of a deck way is the lower way of a crossing whose ladder gives step Full or Thin, under a deck way of the same deck group (WayGraph::decks). A way and water are the same here. A culvert (step Closed over water) is no passage.

    A line from one tag end. The search goes from the tag end into the deck, as today. The A line is the nearer of two points:

    1. Rule 1, square end at the node. The first point where the end line is clear of the paved strokes of the ground arms at the node. The stroke of each arm ends square at the node that it shares with the deck way: its segment at the node is a rectangle, its other segments keep their round ends (the round joins). A straight continuation of the bridge way thus does not push the A line in. A side arm still does.
    2. Rule 2, keep the passage. The last point before the end line touches the stroke of a passage. Where a passage stroke reaches the tag end, the A line is at the tag end.

    The search for rule 2 reads the samples of the way and the stations of its own crossings, then steps of A_STEP_M and a bisection, as place_a does now. Past A_MAX_M rule 1 finds no point. With a passage, rule 2 still gives one, so the way keeps a deck. With no passage the way is ground there, as today.

    deck_min_m. It turns a deck way into a ground way only when the way keeps no passage. A bridge over a way or water with room is a deck however short. A deck way with a passage cannot have zero length between its A lines: each A line stops before the passage stroke.

    Culvert. A deck way over a culvert is ground only when it keeps no passage. (I count how many ways have both and report it.)

    Deck groups (merge_a). The A lines of one group move in together, as today, but a line does not move onto the stroke of a passage.

    Checks.

    • G8: a DECK way that keeps no passage has deck_min_m between its end lines.
    • G9: an A line lies outside the paved strokes of the ground arms (square end at the node), except where it stops at the edge of a passage stroke. An A line lies off every passage stroke, except at its tag end.

    Case distinctions that remain, and why.

    • The segment of an arm at the node gets a square end, its other segments keep round ends. Reason: the node is where the arm and the deck way meet. Past it the arm is a road of its own, and the round join between its segments is part of its stroke.
    • Passage or not: step Full/Thin under a deck of the group. Reason: only there is a way below the deck to keep open.
    • Tag end: an A line cannot move past it.

    There is no case by class, angle, length or junction type.

    Tests (one per invariant). (a) A short bridge with straight approaches over a road has a deck from tag end to tag end (rule 1). (b) A bridge with a side arm at its end over a road near that end has its A line before the road's stroke, not inside the side arm's stroke (rule 2). (c) A bridge 1.5 m long over a stream with room keeps its deck (no lower limit).


    Generated by Claude Code

  3. timohueser commented on Nov 19, 2026

    @timohueser
    OwnerAuthor

    P0: what is built, and rule 1 is parked

    The branch claude/trailview-3639-bridge-passage builds rule 2 only, with two additions. Rule 1 (square end at the node) is parked on claude/trailview-3639-rule1-parked.

    Why rule 1 is parked. Rule 1 moves the deck end on 93 % of all bridge ways and brings the deck to the joint almost everywhere. The deck mesh cannot yet end a deck open at a joint with a bend. On the repo fixture the storeys guards then fail: decks put parapets or railings across the mouth of the way that goes on (3 places), and the edge triangles on stubs at their joints rise from 25 to 78. Rule 1 comes back with the mesh work for an open deck end at a joint.

    What the branch does (graph/levels.rs).

    1. An A line stops before the stroke of a way or water that passes below the deck with room (step Full or Thin). Where such a passage reaches the tag end, the A line is at the tag end.
    2. A bridge that keeps a passage is a deck however short: deck_min_m and the culvert rule do not make it a ground way.
    3. One case distinction: water that runs under a ground arm at the tag end does not hold the A line. Water under a ground way has a general answer already, the culvert; a way under a ground way has none, so a way always keeps its passage.
    4. An A line less than MIN_STEP_M / 2 (6.25 cm) from its tag end lies at the tag end: the graph that the tiles split cuts no shorter stretch at a vertex (curve::insert).
    5. A deck end on a sample keeps its A line (an older fault: such a deck ran on to its tag end, inside the ground arm).

    Census of test box B (2,111 bridges over a way or water with room).

    develop rules 1 + 2 rule 2 (D) rule 2, water exception (branch)
    no deck 74 0 0 3 (streams)
    no deck, over a way 12 0 0 0
    a way below a ground stub 51 1 1 1
    water below a ground stub 18 0 0 3
    G9 faults 24 0 0 0
    deck ways that change 2,347 (93 %) 570 (23 %) 549 (22 %)
    ground stubs under 5 cm 6 15 0 0
    repo fixture: mouth faults / joint triangles 0 / 25 3 / 78 1 / 54 0 / 42

    The way below a stub that remains is a footbridge 2.19 m over a primary road next to it (step 3): it is hidden over the road. That is not a placement of an A line.


    Generated by Claude Code

  4. added a commit that references this issue on Nov 19, 2026
  5. timohueser commented on Nov 19, 2026

    @timohueser
    OwnerAuthor

    Fixed by #3708 (merged): a bridge over a way keeps its passage. Test box B: bridges without a deck 74 → 4 (stream bridges), none over a way. Rule 1 of this issue (square end at the node) is parked on the branch claude/trailview-3639-rule1-parked until the mesh can end a deck at a joint.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions