How does Open Trip Planner build a routing graph using GTFS and OSM street data

881 views
Skip to first unread message

Alfons Natanael

unread,
Sep 30, 2013, 4:38:49 AM9/30/13
to opentrippl...@googlegroups.com
Hi, I was wondering how Open Trip Planner combines public transportation route data (i.e. location of stops and the path taken to reach those stops) from GTFS with OSM's street data to build a routing graph?


Do the points in the GTFS data have to match the points of OSM street nodes? What if the GTFS route paths don't lie exactly on the same location as the streets in OSM? Will Open Trip Planner perceive these two paths/ways as different paths or will it combine them into one?


Andrew Byrd

unread,
Sep 30, 2013, 4:48:32 AM9/30/13
to opentrippl...@googlegroups.com
Hi Alfons,

On 09/30/2013 10:38 AM, Alfons Natanael wrote:
> Hi, I was wondering how Open Trip Planner combines public transportation
> route data (i.e. location of stops and the path taken to reach those
> stops) from GTFS with OSM's street data to build a routing graph?

They are basically two separate layers, only connected together at the
transit stops. GTFS can provide vehicle paths and the time necessary to
reach one place from another without any OSM data.

> Do the points in the GTFS data have to match the points of OSM street
> nodes? What if the GTFS route paths don't lie exactly on the same
> location as the streets in OSM? Will Open Trip Planner perceive these
> two paths/ways as different paths or will it combine them into one?

No, the points in the GTFS data will be used even with no OSM at all. In
both GTFS and OSM, once the data have been loaded the geometries of the
streets are extra information purely for presentation purposes. The main
thing we care about for routing is the time and effort it takes to
traverse each segment. This information is derived directy from GTFS and
precalculated for street segments.

-Andrew

Alfons Natanael

unread,
Oct 8, 2013, 5:08:01 AM10/8/13
to opentrippl...@googlegroups.com
Hi Andrew, thanks for the reply.

Ah, I see. So the GTFS and OSM data are on different layers.

You said that "GTFS can provide vehicle paths and the time necessary to
reach one place from another without any OSM data". Do you mean that GTFS uses the optional Shape.txt file to determine the path to take between stops?

P.S. Sorry for the late reply.

Alfons.

Andrew Byrd

unread,
Oct 8, 2013, 5:16:38 AM10/8/13
to opentrippl...@googlegroups.com
On 10/08/2013 11:08 AM, Alfons Natanael wrote:
> You said that "GTFS can provide vehicle paths and the time necessary to
> reach one place from another without any OSM data". Do you mean that
> GTFS uses the optional Shape.txt file to determine the path to take
> between stops?

The optional shapes.txt does provide additional detail for drawing the
result on a map, but the actual path taken by the vehicle is largely
irrelevant for public transport routing. GTFS provides the times at
which every vehicle passes every stop.

-Andrew

Alfons Natanael

unread,
Oct 8, 2013, 5:58:04 AM10/8/13
to opentrippl...@googlegroups.com
So The Shapes.txt is purely cosmetic.
Okay. I think I understand now.

Thanks for your explanation Andrew. =D
Reply all
Reply to author
Forward
0 new messages