Skip to content

JSON config > + use_parent_stop_id_for_stop_id...#69

Merged
mmathieum merged 3 commits into
masterfrom
mm/add_use_parent_stop_id_for_stop_id
May 29, 2026
Merged

JSON config > + use_parent_stop_id_for_stop_id...#69
mmathieum merged 3 commits into
masterfrom
mm/add_use_parent_stop_id_for_stop_id

Conversation

@mmathieum
Copy link
Copy Markdown
Member

No description provided.

@mmathieum mmathieum self-assigned this May 29, 2026
@mmathieum mmathieum marked this pull request as ready for review May 29, 2026 13:19
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/main/java/org/mtransit/parser/DefaultAgencyTools.java
Comment thread src/main/java/org/mtransit/parser/gtfs/data/GStop.kt Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_id to RouteConfig and 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.

Comment thread src/main/java/org/mtransit/parser/DefaultAgencyTools.java Outdated
Comment thread src/main/java/org/mtransit/parser/gtfs/GAgencyTools.java
@mmathieum mmathieum merged commit ecdcfbf into master May 29, 2026
4 checks passed
@mmathieum mmathieum deleted the mm/add_use_parent_stop_id_for_stop_id branch May 29, 2026 13:50
montransit added a commit to mtransitapps/mtransit-for-android that referenced this pull request May 29, 2026
montransit added a commit to mtransitapps/us-anchorage-people-mover-bus-android that referenced this pull request May 29, 2026
- 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
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.

2 participants