Skip to content

feat: add OSM node IDs to ExtractionSegment for Lua process_segment [wip]#7600

Open
hamishcampbell wants to merge 1 commit into
Project-OSRM:masterfrom
uintel:hc/node-ids-in-process-segment
Open

feat: add OSM node IDs to ExtractionSegment for Lua process_segment [wip]#7600
hamishcampbell wants to merge 1 commit into
Project-OSRM:masterfrom
uintel:hc/node-ids-in-process-segment

Conversation

@hamishcampbell

Copy link
Copy Markdown

Issue

No directly corresponding issue however this came about due to our inability to fix the bug here #7332

In the above issue we discovered problems while adjusting the speed of closed segments. We burned a week or two attempting to solve it without success however so we settled on modify the network at extract time as a much more reliable approach to setting road closure for large scale analysis.

To do this we need to be able to close specific segments but the process_segment function only exposed the lat/log of the relevant nodes. With this relatively minor change we can get access to the OSM source/target node IDs which are a stable ID vs attempting to use the coordinates themselves.

AI tools: Claude code assisted in generating this change, although with close human intervention/supervision.

Seeking comments on whether this is something that is generally useful before adding tests etc.

Change Summary

  • Add osm_source_id and osm_target_id fields to ExtractionSegment struct
  • Pass OSM node IDs during segment creation in extraction_containers
  • Expose node IDs to Lua scripting environment

This allows profiles to:

  • Create stable segment identifiers across runs
  • Reference segments by OSM node pairs (e.g., 12345->67890)
  • Load external segment-specific data by ID
  • Pass routing changes by segment ID instead of coordinates

Tasklist

Requirements / Relations

N/A

This change exposes OSM source and target node IDs to the Lua
process_segment function, enabling segment identification by stable
OSM node IDs rather than just coordinates.

Changes:
- Add osm_source_id and osm_target_id fields to ExtractionSegment struct
- Pass OSM node IDs during segment creation in extraction_containers
- Expose node IDs to Lua scripting environment

This allows profiles to:
- Create stable segment identifiers across runs
- Reference segments by OSM node pairs (e.g., 12345->67890)
- Load external segment-specific data by ID
- Pass routing changes by segment ID instead of coordinates
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