Skip to content

feat(valhalla): add gtfs parsing in graph#95

Open
azarz wants to merge 11 commits into
mainfrom
feat/add-gtfs-parsing-to-valhalla
Open

feat(valhalla): add gtfs parsing in graph#95
azarz wants to merge 11 commits into
mainfrom
feat/add-gtfs-parsing-to-valhalla

Conversation

@azarz

@azarz azarz commented Jun 30, 2026

Copy link
Copy Markdown
Member

No description provided.

@azarz azarz self-assigned this Jul 8, 2026
@azarz
azarz requested review from VincentMiras and Copilot July 8, 2026 11:43
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1725 554 32% 0% 🟢

New Files

File Coverage Status
r2gg/gtfs_pipeline/init.py 100% 🟢
r2gg/gtfs_pipeline/main.py 0% 🟢
r2gg/gtfs_pipeline/config.py 100% 🟢
r2gg/gtfs_pipeline/get_all_gtfs.py 9% 🟢
r2gg/gtfs_pipeline/gtfs_clean.py 8% 🟢
r2gg/gtfs_pipeline/pipeline.py 67% 🟢
r2gg/gtfs_pipeline/utils/init.py 100% 🟢
r2gg/gtfs_pipeline/utils/file_utils.py 25% 🟢
r2gg/gtfs_pipeline/utils/geom_utils.py 0% 🟢
TOTAL 45% 🟢

Modified Files

File Coverage Status
r2gg/_main.py 28% 🟢
TOTAL 28% 🟢

updated for commit: cbd8b1c by action🐍

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional GTFS download/cleaning pipeline that can run before Valhalla tile generation, enabling transit feeds to be incorporated into Valhalla graphs. It also documents the new config block and updates example docker configs accordingly.

Changes:

  • Introduce r2gg.gtfs_pipeline package (download, clean, optional department split, merge helper, CLI entrypoint).
  • Integrate GTFS preprocessing into r2gg/_main.py Valhalla conversion and pass transit-related Valhalla build args when enabled.
  • Update documentation, sample configs, CI install steps, and Python dependencies to support the GTFS pipeline.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_gtfs_integration.py Adds tests around GTFS config parsing patterns and PipelineConfig defaults.
requirements/base.txt Adds new third-party dependencies needed by the GTFS pipeline.
README.md Documents optional gtfs config block for Valhalla sources.
r2gg/gtfs_pipeline/utils/geom_utils.py Adds GTFS stop-coverage bounds extraction helper.
r2gg/gtfs_pipeline/utils/file_utils.py Adds CSV-reading helper used across pipeline modules.
r2gg/gtfs_pipeline/utils/init.py Declares utils package.
r2gg/gtfs_pipeline/pipeline.py Orchestrates end-to-end pipeline execution from config.
r2gg/gtfs_pipeline/merge_gtfs.py Adds a utility to merge multiple GTFS feeds into a single directory with prefixed IDs.
r2gg/gtfs_pipeline/gtfs_departements.py Adds optional splitting of cleaned GTFS feeds by GeoJSON features (departments).
r2gg/gtfs_pipeline/gtfs_clean.py Implements GTFS cleaning/filtering and produces a processing report.
r2gg/gtfs_pipeline/get_all_gtfs.py Implements dataset selection, download, and extraction from transport.data.gouv.fr API.
r2gg/gtfs_pipeline/config.py Defines PipelineConfig and DepartmentSplitConfig dataclasses.
r2gg/gtfs_pipeline/main.py Adds CLI for running the pipeline standalone.
r2gg/gtfs_pipeline/init.py Exposes the public API for the GTFS pipeline package.
r2gg/_main.py Integrates GTFS preprocessing into Valhalla generation flow and adds required Valhalla args.
docs/usage/r2gg.md Documents the gtfs config block and behavior under osm2valhalla().
docker/config/bdtopo2valhalla.json Adds example gtfs block; adds multimodal cost profile and date_time input id.
docker/config/bdtopo2valhalla_local.json Same as above for local config.
docker/config/bdtopo2valhalla_idf.json Adds date_time input id.
.github/workflows/unit-test.yml Installs base requirements during unit test workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread r2gg/gtfs_pipeline/utils/file_utils.py Outdated
Comment thread r2gg/gtfs_pipeline/utils/geom_utils.py Outdated
Comment thread r2gg/gtfs_pipeline/utils/geom_utils.py
Comment thread r2gg/gtfs_pipeline/gtfs_clean.py Outdated
Comment thread r2gg/gtfs_pipeline/get_all_gtfs.py
Comment thread r2gg/gtfs_pipeline/get_all_gtfs.py
Comment thread requirements/base.txt Outdated
Comment thread tests/test_gtfs_integration.py Outdated
azarz and others added 4 commits July 10, 2026 09:16
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot stopped work on behalf of azarz due to an error July 10, 2026 07:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot finished work on behalf of azarz July 10, 2026 07:25
@azarz
azarz marked this pull request as ready for review July 10, 2026 07:40

@VincentMiras VincentMiras left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

merge gtfs et gtfs departements ne sont théorquement plus utiles

@azarz

azarz commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

@copilot Remove the code from gtfs_departements and gtfs_merge, and remove all possibility to call them including the parameters for the gtfs pipeline.

Copilot AI commented Jul 10, 2026

Copy link
Copy Markdown

@copilot Remove the code from gtfs_departements and gtfs_merge, and remove all possibility to call them including the parameters for the gtfs pipeline.

Done. I've removed the gtfs_departements and merge_gtfs modules along with all related functionality, including:

  • Deleted gtfs_departements.py and merge_gtfs.py files
  • Removed DepartmentSplitConfig class and departement_split parameter from PipelineConfig
  • Removed gtfs_departements import and usage from pipeline.py
  • Removed all --deps-* CLI arguments from main.py
  • Updated init.py to remove DepartmentSplitConfig exports
  • Updated tests to remove departement_split references

All tests pass successfully.

Copilot finished work on behalf of azarz July 10, 2026 14:33
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.

4 participants