Using OTP without street data (OSM+GTFS)

704 views
Skip to first unread message

Igor Petruk

unread,
Jun 25, 2013, 11:46:45 AM6/25/13
to opentrippl...@googlegroups.com
Hello.

The issue

I am trying to use OTP to find shortest ways on London Underground (+potentially Buses). I would prefer to do the following.
  1. Specify stops.txt and other data related to underground trips in GTFS
  2. Specify transfers.txt to provide estimates on stations transfers.
  3. Send a request to /path, specifying stop id's as "from" and "to"
  4. OTP should find the shortest path on the Underground not trying to use outdoor streets, but simply take time estimates from transfers.txt
Is it possible to configure OTP to do the described above?

Are there any obstacles to use this approach for buses? Apparently bus routes cannot be specified purely from GTFS.

What I have tried so far

I have configured GraphBuilder only with org.opentripplanner.graph_builder.impl.GtfsGraphBuilderImpl with all the inputs provided. It builds Graph.obj without errors. When I issue /path request it returns the error "Trip is not possible. You might be trying to plan a trip outside the map data boundary."

I could configure OTP like wiki suggests using "Streets + Transit Data Linkage", how wiki suggests. But this is not solving the business requirement to ignore streets outside of stations.

Thank you,
Igor

andrew byrd

unread,
Jun 26, 2013, 5:04:27 AM6/26/13
to opentrippl...@googlegroups.com
Hi Igor,

On Tue, Jun 25, 2013, at 17:46, Igor Petruk wrote:
> 1. Specify stops.txt and other data related to underground trips in
> GTFS
> 2. Specify transfers.txt to provide estimates on stations transfers.

Are you sure to have complete set of transfers from every stop/platform
to every other one within reasonable walking distance? If so this would
indeed be a good way to handle transfers, but you'll need a lot of
detailed data.

> 4. OTP should find the shortest path on the Underground *not trying to
> use outdoor streets*, but simply take time estimates from
> transfers.txt
> Is it possible to configure OTP to do the described above?

This is in some ways much simpler than what we usually do so yes, OTP
could certainly work this way. transfersTxtDefinesStationPaths already
does something similar to what you need. If transfers.txt is the only
source of transfers, not just a supplement, you might want to write a
custom graph builder module to add missing transfers based on distance
etc.

> Are there any obstacles to use this approach for buses? Apparently bus
> routes cannot be specified purely from GTFS.

Why are you having trouble specifying bus routes in GTFS?

> I have configured GraphBuilder only
> with org.opentripplanner.graph_builder.impl.GtfsGraphBuilderImpl with all
> the inputs provided. It builds Graph.obj without errors. When I issue
> /path
> request it returns the error "Trip is not possible. You might be trying
> to
> plan a trip outside the map data boundary."

There are simply no streets with which to reach the transit network, and
no streets through which to transfer. You may not see any errors but you
should get a lot of warnings about unlinked stops.

> I could configure OTP like wiki suggests using "Streets + Transit Data
> Linkage", how wiki suggests. But this is not solving the business
> requirement to ignore streets outside of stations.

If you want to just get it working until you have a stop-linker module
for your specific use case, try adding the StreetlessStopLinker to your
graphbuilder configuration. This will connect stops together based on
distance.

-Andrew

Igor Petruk

unread,
Jun 27, 2013, 5:38:36 AM6/27/13
to opentrippl...@googlegroups.com
Thank you for response.

I don't specify street names, I use exact stop ID's, which should be a Vertex description for exact stop. It doesn't need to walk a single feet on the street as well as I understand. But the user does need to walk on transfers, I have supplied all in-station transfers in transfers.txt. Do I need to populate it also for inter-station transfers?

I think I am a bit confused about location of domain data. Is underground path data included in OSM? Because train path in not really a street. Or is it treated as as a kind of street (or something else) and included in OSM? If it is not in OSM, then it must be in GTFS, not just transfer time, but the actual path. Is this what trips.txt is all about? If I specify transfers.txt, trips.txt, stops.txt and us exact stop ID's as from/to, should it work without OSM data?

Thanks,
Igor

среда, 26 июня 2013 г., 12:04:27 UTC+3 пользователь Andrew Byrd написал:

Andrew Byrd

unread,
Jun 27, 2013, 6:20:14 AM6/27/13
to opentrippl...@googlegroups.com
On 06/27/2013 11:38 AM, Igor Petruk wrote:
> I don't specify street names, I use exact stop ID's, which should be a
> Vertex description for exact stop. It doesn't need to walk a single feet
> on the street as well as I understand. But the user does need to walk on
> transfers, I have supplied all in-station transfers in transfers.txt. Do
> I need to populate it also for inter-station transfers?

The OTP API if often called from map-based trip planners, so endpoints
are often specified as coordinates and the nearest edge or vertex is
used as the starting point.

If you want to start at a specific vertex, you can specify vertex IDs in
the fromPlace and toPlace query parameters, and stops have vertex IDs
like agency_stopid, so you can do
"?fromPlace=agency_stop&toPlace=agency_otherstop".

> I think I am a bit confused about location of domain data. Is
> underground path data included in OSM? Because train path in not
> really a street.

Underground paths could be included in OSM. What kind of underground
path are you thinking of, paths between stops like walking tunnels in a
metro system? I don't understand the connection with trains. GTFS and
OSM are separate data sets and will only be harmonized in some cities,
so GTFS may contain transfers that are not mapped in OSM and vice versa.

> Or is it treated as as a kind of street (or something else)
> and included in OSM? If it is not in OSM, then it must be in GTFS, not
> just transfer time, but the actual path.

We do not use OSM data for on-transit legs. All transit data comes from
GTFS, including the path taken by trains (from shapes.txt). The "shapes"
are optional and not necessary for routing since we have a table of all
the inter-stop times.

> Is this what trips.txt is all
> about? If I specify transfers.txt, trips.txt, stops.txt and us exact
> stop ID's as from/to, should it work without OSM data?

The purpose and content of the files making up a GTFS feed is described
in detail at https://developers.google.com/transit/gtfs/reference. OTP
should work with no OSM data if 1) you specify endpoints as stop
vertices, 2) you specify all transfers anyone could ever want to make in
transfers.txt (that's going to be a big list), and 3) you tell the graph
builder to create transfers based on transfers.txt, not by linking to OSM.

-Andrew

Andrew Byrd

unread,
Jun 27, 2013, 6:23:20 AM6/27/13
to opentrippl...@googlegroups.com
On 06/27/2013 11:38 AM, Igor Petruk wrote:
> I don't specify street names, I use exact stop ID's, which should be a
> Vertex description for exact stop. It doesn't need to walk a single feet
> on the street as well as I understand. But the user does need to walk on
> transfers, I have supplied all in-station transfers in transfers.txt. Do
> I need to populate it also for inter-station transfers?

Yes. The transfers have to come from somewhere. If you're not using OSM,
you have to specify them in GTFS. If you don't want to use OSM you will
need to link stations together some other way, e.g. based on
straight-line distance (which might not be very relevant for deep metro
stations).

-Andrew

Igor Petruk

unread,
Jun 27, 2013, 6:33:37 AM6/27/13
to Andrew Byrd, opentrippl...@googlegroups.com
Thanks,

As noted in one of the previous answers, if I don't want to use OSM, but I want accurate results, then shapes.txt can be a sources of accurate path data, right?


2013/6/27 Andrew Byrd <and...@fastmail.net>

-Andrew

--
You received this message because you are subscribed to a topic in the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/opentripplanner-users/NxcCqa3npDU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to opentripplanner-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Andrew Byrd

unread,
Jun 27, 2013, 6:37:29 AM6/27/13
to Igor Petruk, opentrippl...@googlegroups.com
On 06/27/2013 12:33 PM, Igor Petruk wrote:
> Thanks,
>
> As noted in one of the previous answers, if I don't want to use OSM, but
> I want accurate results, then shapes.txt can be a sources of accurate
> path data, right?

It depends what you mean by "accurate results". Shapes.txt will make for
better _rendering_ of the results on a map. Without it, the best you can
do is connect stations together with a straight line. With it, each
transit leg will include a detailed shape you can draw on a map.
However, you can produce perfectly accurate journey plans (in terms of
times and transfer instructions) with no shapes.txt.

-Andrew

Igor Petruk

unread,
Jun 27, 2013, 6:45:21 AM6/27/13
to Andrew Byrd, opentrippl...@googlegroups.com
Ah, ok. I see, it is for rendering only. Thanks


2013/6/27 Andrew Byrd <and...@fastmail.net>
Reply all
Reply to author
Forward
0 new messages