gap: on a multi-track crossing one of the two barriers stands between the rails #287

Open
viberfox-agent wants to merge 1 commit from fix/232-crossing-clearance-from-rails into main
Collaborator

Closes #232

Merged by the autopilot (docs/direction.md) after every Actions job passed on the branch head.

Closes #232 Merged by the autopilot (docs/direction.md) after every Actions job passed on the branch head.
fix(geo): measure a crossing's spacing from the tile's rail, not the register
All checks were successful
CI / test cartopolis (pull_request) Successful in 11m15s
CI / wasm & android targets (pull_request) Has been skipped
10bcb20f18
The gap between a level crossing's two installations came from ProRail's
`aantal_sporen` alone. At the Peizerweg AHOB in Groningen the register says
one track, so the pair stood 7 m apart — and the z14 tile the crossing is
meshed from carries two running lines crossing that road, 0.5 m and 5.9 m
from the published point. The northern installation stood between them, mast
in the second track's ballast, with that track unguarded.

The tile already had the answer and the seam to reach it. `place_crossings`
builds a `WayField` with `WayFilter::ExcludingRail` precisely because the
register's point sits on the rail centreline; the complementary filter —
written as the negation of that arm, so there is one list of rail kinds and
not two — indexes exactly the ways it drops. `WayField::crossing_span` then
takes the point, the yaw just resolved and a radius, keeps only segments whose
endpoints fall on opposite sides of the road line, and answers the greatest
|offset along the road| at which one crosses it. A rail running parallel to
the road never crosses it and widens nothing, which is the case a nearest-way
query would get wrong.

`aantal_sporen` becomes the floor rather than the source:
`max(register, measured + setback)`, clamped to the ceiling the register's own
16-track cap already allowed. `max` because both sources undercount and
neither can be shown to overcount — the register undercounts here, and OSM
undercounts wherever a double track is mapped as one way, which taken
verbatim would pull a two-track crossing back in to 3.5 m. It is also this
project's standing rule for surveyed data: add, don't replace.

The span is one magnitude applied to both sides, not a per-side offset:
`direction_and_width` leaves the yaw's sign unresolved, so everything built on
it must be symmetric under a half turn, and the Peizerweg's real asymmetry is
deliberately collapsed to the larger. With no rail in the tile — every cell
outside the Netherlands — `rail_span` is `None` and every form is placed
exactly where it was.

Verified against the real tile, added as `peizerweg_z14.mvt`: the measured
span is 5.89 m and the installations move from 3.5 m to 9.4 m out. No new
geometry, so `MAX_BOXES_PER_CROSSING` and the byte accounting are unchanged.

Refs #232
All checks were successful
CI / test cartopolis (pull_request) Successful in 11m15s
CI / wasm & android targets (pull_request) Has been skipped
This pull request has changes conflicting with the target branch.
  • crates/geo/src/crossings.rs
  • docs/notes/prorail-level-crossings.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/232-crossing-clearance-from-rails:fix/232-crossing-clearance-from-rails
git switch fix/232-crossing-clearance-from-rails

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/232-crossing-clearance-from-rails
git switch fix/232-crossing-clearance-from-rails
git rebase main
git switch main
git merge --ff-only fix/232-crossing-clearance-from-rails
git switch fix/232-crossing-clearance-from-rails
git rebase main
git switch main
git merge --no-ff fix/232-crossing-clearance-from-rails
git switch main
git merge --squash fix/232-crossing-clearance-from-rails
git switch main
git merge --ff-only fix/232-crossing-clearance-from-rails
git switch main
git merge fix/232-crossing-clearance-from-rails
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jeroen/cartopolis!287
No description provided.