Skip to content

Enchantments to the routing output with GTFS data.#3127

Open
elvedin-hamzagic wants to merge 11 commits into
graphhopper:masterfrom
elvedin-hamzagic:master
Open

Enchantments to the routing output with GTFS data.#3127
elvedin-hamzagic wants to merge 11 commits into
graphhopper:masterfrom
elvedin-hamzagic:master

Conversation

@elvedin-hamzagic

Copy link
Copy Markdown

Added route_type, agency_id and agency_name to a route leg for 'pt' legs.

route_type - type of the vehicle used in public transport, e.g. 3 for a bus, 0 for a tram and 11 for a trolley
agency_id - the ID of the operator as stated in the GTFS table agencies.txt
agency_name - the name of the operator

@elvedin-hamzagic

Copy link
Copy Markdown
Author

Further enhancements in output data of "/route" endpoint:

  • Fixed "distance" for public transport legs. The current implementation of routing didn't take into consideration the distance of PT legs, because it relied solely on timestamps from "stop_times" GTFS table, so the distance was always 0. In this implementation the distance has been calculated from GTFS table "shapes", if the table exists. If the table does not exist, the distance is still 0.

  • Added "shapes" field to the output for pricise route drawing. This field contains LineString geometry, which are coordinates taken from "shapes" table from GTFS feed. In case there is no table in the feed, it will be empty. Current implementation includes "geometry" field, but it contains only coordinates of stations.

In the future, we could add an input parameter in the request to control whether "shape" field should be included in the output, because the output size can increase significantly, approximately around 20-25%.

@michaz michaz self-requested a review August 3, 2025 16:58
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