Skip to content

Conversation

@aschantraine
Copy link
Contributor

@aschantraine aschantraine commented Dec 24, 2025

Implements full logic for /level_crossing_occupancy/ endpoint assuming all trains are PacedTrain:

  • Move interpolate_arrival_time() from track_occupancy.rs to projection.rs to be reused for level_crossing_occupancy
  • Add track_offset() method to LevelCrossing schema
  • Implement complete occupancy calculation workflow:
    • Load infra, level crossings and trains
    • Run train pathfinding and simulation
    • Compute occupancy time windows
    • Group results by level crossing ID
    • Skip trains with missing rolling stock, failed simulations, no pedal intersection, or that do not fully traverse the short zone
  • Add i18n messages for level_crossing errors in en and fr
  • Add tests

This only works for PacedTrain as long as the TrainSchedule migration has not been completed.

…jection

Signed-off-by: aschantraine <aschantraine@free.fr>
@github-actions github-actions bot added the area:editoast Work on Editoast Service label Dec 24, 2025
@aschantraine aschantraine linked an issue Dec 24, 2025 that may be closed by this pull request
1 task
@aschantraine aschantraine changed the title editoast: implement level_crossing_occupancy endpoint logic editoast: implement /level_crossing_occupancy endpoint logic Dec 24, 2025
@aschantraine aschantraine changed the title editoast: implement /level_crossing_occupancy endpoint logic editoast: implement /level_crossing_occupancy endpoint logic Dec 24, 2025
Signed-off-by: aschantraine <aschantraine@free.fr>
@github-actions github-actions bot added area:front Work on Standard OSRD Interface modules kind:api-change labels Dec 24, 2025
@github-actions
Copy link
Contributor

⚠️ API changes

This Pull Request introduces some changes in the API:

  • please own it: notify or even prepare dedicated PR(s) to consumer projects

Changes in Schemas

Dear @aschantraine, please ensure the following:

@aschantraine aschantraine force-pushed the ace/level_crossing_occupancy branch from 5e25229 to ed563d5 Compare December 24, 2025 16:37
- Load infra, level crossings and trains
- Run train pathfinding and simulation
- Compute occupancy time windows
- Group results by level crossing ID
- Skip trains with missing rolling stock, failed simulations, no pedal intersection, or that do not fully traverse the short zone
- Add i18n messages for level_crossing errors in en and fr

Signed-off-by: aschantraine <aschantraine@free.fr>
@aschantraine aschantraine force-pushed the ace/level_crossing_occupancy branch from ed563d5 to 79833c2 Compare December 24, 2025 16:40
@aschantraine aschantraine marked this pull request as ready for review December 24, 2025 16:58
@aschantraine aschantraine requested review from a team as code owners December 24, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editoast Work on Editoast Service area:front Work on Standard OSRD Interface modules kind:api-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a new endpoint to get level_crossings occupation

2 participants