JSON config > + use_parent_stop_id_for_stop_id...#69
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for using parent stop IDs instead of stop IDs via a new configuration option useParentStopIdForStopId. It also cleans up the parsing of parent station IDs in GStop.kt and simplifies some logic in GenerateMObjectsTask.java. Feedback on these changes suggests caching the result of gStop.getParentStationId() to avoid redundant, inefficient lookups, and ensuring that blank parent station IDs are treated as null during parsing.
There was a problem hiding this comment.
Pull request overview
Adds JSON-configurable support for deriving stop IDs from parent_station, alongside minor cleanup/refactoring in stop parsing and route long-name generation.
Changes:
- Adds
use_parent_stop_id_for_stop_idtoRouteConfigand exposes it through agency tools. - Updates stop ID generation to optionally use a stop’s parent station ID.
- Cleans parent station IDs during GTFS stop parsing and simplifies small formatting paths.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/org/mtransit/parser/mt/GenerateMObjectsTask.java |
Refactors route long-name helper formatting without functional change. |
src/main/java/org/mtransit/parser/gtfs/GAgencyTools.java |
Adds the agency-tools hook for parent-station-based stop IDs. |
src/main/java/org/mtransit/parser/gtfs/data/GStop.kt |
Simplifies toStringPlus and cleans parsed parent_station values. |
src/main/java/org/mtransit/parser/DefaultAgencyTools.java |
Implements parent-station stop ID selection and exposes the new route config value. |
src/main/java/org/mtransit/parser/config/gtfs/data/RouteConfig.kt |
Adds the new JSON config field with a default disabled value. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- parser: Lower min calendar coverage in days to avoid service ID conflicts #AnchoragePeopleMover - parser: `JSON` config > + `use_parent_stop_id_for_stop_id`... mtransitapps/parser#69
No description provided.