Skip to content

Trip-Based Public Transit Routing - #3184

Merged
michaz merged 211 commits into
masterfrom
patterns
Aug 5, 2025
Merged

michaz merged 211 commits into
masterfrom
patterns

Conversation

@michaz

@michaz michaz commented Aug 3, 2025 •

Copy link
Copy Markdown
Member

This implements Trip-Based Public Transit Routing by Sascha Witt as an additional solver for public transit queries.

It is, of course, much faster than the current solver, especially for profile queries. (Where I want to get all routes that are optimal at some point in a time interval.)

It loads and pre-processes and runs national networks on laptops, and has been known to work for continental networks on bigger servers.

Current limitations:

  • No query by arrival time.
  • Each schedule day that we want to query needs to be preprocessed. As this code was written for an analysis task, we expect the required days to be listed in the config file. For a customer-facing transit information server, there's still a gap or two to be closed here.
  • No GTFS-Realtime.
  • As with the classic solver, no free walking. You get the transfers that are in the GTFS file, plus everything that can be walked within a time budget fixed at config time.

Implementation notes:

  • No attempt at systems-level code optimization such as off-heap data structures. The schedule is just lots of Java objects.
  • The profile query is an embarrassing for-loop over each minute in the time interval but it's still fast.
graphhopper:
  datareader.file: /Users/michaelzilske/Downloads/germany-latest.osm-2.pbf
  gtfs.file: /Users/michaelzilske/Downloads/Upload__hvv_Rohdaten_GTFS_Fpl_20250108
  graph.encoded_values: car_access, road_access, car_average_speed, foot_access, hike_rating, mtb_rating, foot_priority, country, road_class, foot_road_access, foot_average_speed

  graph.location: graph-hvv
  graph.dataaccess.default_type: RAM_STORE

  gtfs.trip_based: true
  gtfs.schedule_day: 2025-08-05,2025-08-06

  gtfs.max_transfer_interpolation_walk_time_seconds: 300

  profiles:
    - name: car
      turn_costs:
        vehicle_types: [motorcar, motor_vehicle]
        u_turn_costs: 60
      custom_model_files: [car.json]
    - name: foot
      custom_model_files: [foot.json]

http://localhost:8900/maps/pt/

michaz added 2 commits August 4, 2025 18:52
# Conflicts:
#	reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphExplorer.java
#	reader-gtfs/src/main/java/com/graphhopper/gtfs/RealtimeFeed.java
#	reader-gtfs/src/test/java/com/graphhopper/AnotherAgencyIT.java
#	reader-gtfs/src/test/java/com/graphhopper/GraphHopperGtfsIT.java
#	reader-gtfs/src/test/java/com/graphhopper/GraphHopperMultimodalIT.java
#	web-api/src/main/java/com/graphhopper/jackson/ResponsePathSerializer.java
#	web-bundle/src/main/java/com/graphhopper/resources/PtRouteResource.java
#	web/src/test/java/com/graphhopper/application/resources/PtRouteResourceTest.java
# Conflicts:
#	reader-gtfs/src/main/java/com/graphhopper/gtfs/GraphExplorer.java
#	reader-gtfs/src/main/java/com/graphhopper/gtfs/RealtimeFeed.java
#	reader-gtfs/src/test/java/com/graphhopper/AnotherAgencyIT.java
#	reader-gtfs/src/test/java/com/graphhopper/GraphHopperGtfsIT.java
#	reader-gtfs/src/test/java/com/graphhopper/GraphHopperMultimodalIT.java
#	web-api/src/main/java/com/graphhopper/jackson/ResponsePathSerializer.java
#	web-bundle/src/main/java/com/graphhopper/resources/PtRouteResource.java
#	web/src/test/java/com/graphhopper/application/resources/PtRouteResourceTest.java
@michaz michaz changed the title Patterns Trip-Based Public Transit Routing Aug 5, 2025
@michaz
michaz marked this pull request as ready for review August 5, 2025 09:59
@michaz
michaz merged commit a148d51 into master Aug 5, 2025
@michaz
michaz deleted the patterns branch August 5, 2025 10:30
@karussell karussell added this to the 11.0 milestone Aug 5, 2025

This branch was previously deployed

1 inactive deployment
benchmarks — 3b9d4ae2 Deployed Aug 4, 2025 by michaz
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