feat: add OSM node IDs to ExtractionSegment for Lua process_segment [wip]#7600
Open
hamishcampbell wants to merge 1 commit into
Open
feat: add OSM node IDs to ExtractionSegment for Lua process_segment [wip]#7600hamishcampbell wants to merge 1 commit into
hamishcampbell wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_segmentfunction 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
osm_source_idandosm_target_idfields to ExtractionSegment structextraction_containersThis allows profiles to:
Tasklist
Requirements / Relations
N/A