As you can see, it looks at the "exemplar". In this case, where more
than one bus trip runs along the same pattern (that is, the same stops
in the same order), they are combined into one set of edges, instead of
having one per trip. We choose an arbitrary trip to be the exemplar --
the trip from which we get general information.
Since I wrote the exemplar code, I think we started to store the trip
objects for every trip, so maybe it would be possible to just change the
getName method to look at the actual trip.
On Thu, 2010-05-27 at 17:43 -0400, Nicholas Bergson-Shilcock wrote:
Excerpts from Krzysztof Witalewski's message of Wed May 26 08:59:54 -0400 2010:
Hi Nicholas,
I suppose that we are having some problem with OTP graph builder.
This is something that I would normally file as a ticket on otp trac, but I
suppose it's not possible to solve this issue without taking a look at our
GTFS data which we are not allowed to give anyone without previous signing
of a declaration that you have signed for us a couple of months ago.
We noticed that when we try to plan a trip between "GÓRCZYN DWORZEC" (stop
id 1922 in our gtfs feed) and "Świerczewo" (stop id 1261 in our gtfs feed)
in Poznań, OTP finds a right connection, but provides us with wrong route
name. The quickest connection between these two stops is by the "75" day bus
(route id 3118 in our gtfs feed) or the "249" night bus (route id 3043 in
our gtfs feed). The problem is, that the planner always tells us to take
bus "249", no matter whether the actual trip is really on a "249" or a "75"..
For example, when we try to plan a trip around 8:36 AM, it will tell us to
board bus "249" at 8:36. The only bus that really departs this stop at 8:36
is "75".
If we try to plan a trip around 3:18 AM, it will tell us to board "249" at
3:18 which is alright.
I'm sure that our gtfs feed is ok here and I wonder if this could be some
error of the OTP graph builder or maybe of the OTP routing engine. Could you
please try to help us with this if you have a while?
You can reproduce this error, trying to plan a journey between "GÓRCZYN
DWORZEC" and "Świerczewo" at iplaner.pl (you can just type "gorczyn" and
"swierczewo" without polish special chars)
.
think I know what is going on here. Note that I have only figured this out by pure thought -- I have not actually tested this.
The route in the web service comes from calling getName() on the patternhop:
http://opentripplanner.org/browser/trunk/opentripplanner-routing/src/main/java/org/opentripplanner/routing/edgetype/PatternHop.java#L67
As you can see, it looks at the "exemplar". In this case, where more than one bus trip runs along the same pattern (that is, the same stops in the same order), they are combined into one set of edges, instead of having one per trip. We choose an arbitrary trip to be the exemplar -- the trip from which we get general information.
Since I wrote the exemplar code, I think we started to store the trip objects for every trip, so maybe it would be possible to just change the getName method to look at the actual trip.
If this doesn't work, you could patch GTFSPatternHopFactory to treat route as another part of the key for a pattern. See: http://opentripplanner.org/browser/trunk/opentripplanner-routing/src/main/java/org/opentripplanner/routing/edgetype/factory/GTFSPatternHopFactory.java#L79
Patches on this will gladly be accepted.
On Thu, 2010-05-27 at 17:43 -0400, Nicholas Bergson-Shilcock wrote: