Skip to content

Fix: Ensure type safety for OSM tags and IDs#2

Open
rodrigost23 wants to merge 1 commit into
whubsch:mainfrom
rodrigost23:fix/type-safety
Open

Fix: Ensure type safety for OSM tags and IDs#2
rodrigost23 wants to merge 1 commit into
whubsch:mainfrom
rodrigost23:fix/type-safety

Conversation

@rodrigost23

Copy link
Copy Markdown

This PR introduces a few necessary fixes to prevent crashes during the GTFS to OSM conversion process, specifically regarding tag types and handling responses from the Overpass API.

Changes proposed in this pull request:

  • Enforce string types for OSM tags: Added dictionary comprehensions to ensure all keys and values are strictly cast to strings, while also stripping out any None values. This prevents downstream crashes when generating the OSM XML, which expects string-only tags.
  • Robust Overpass API node handling: Safely skip elements if the Overpass API returns a node without an ID, preventing KeyError crashes, and explicitly cast the node_id to an int.

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