Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading GTFS data fails in 0.19 but works in 0.18 #2113

Closed
ardoi opened this issue Aug 30, 2015 · 4 comments
Closed

Reading GTFS data fails in 0.19 but works in 0.18 #2113

ardoi opened this issue Aug 30, 2015 · 4 comments
Assignees
Labels

Comments

@ardoi
Copy link

ardoi commented Aug 30, 2015

Working with San Bernardino's Omnitrans GTFS data and OSM data for LA I get the following error when when starting OTP server:

Exception in thread "main" java.lang.RuntimeException: Could not interpolate arrival/departure time on stop 17 (missing final stop time) on trip <Trip OMNITRANS_715615>
    at org.opentripplanner.routing.edgetype.factory.GTFSPatternHopFactory.interpolateStopTimes(GTFSPatternHopFactory.java:999)
    at org.opentripplanner.routing.edgetype.factory.GTFSPatternHopFactory.run(GTFSPatternHopFactory.java:387)
    at org.opentripplanner.graph_builder.module.GtfsModule.buildGraph(GtfsModule.java:130)
    at org.opentripplanner.graph_builder.GraphBuilder.run(GraphBuilder.java:160)
    at org.opentripplanner.standalone.OTPMain.run(OTPMain.java:113)
    at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:88)

Using 0.19 OTP:

$ java -Xmx2G -jar otp-0.19.0-SNAPSHOT-shaded.jar --version
version: 0.19.0-SNAPSHOT
major: 0
minor: 19
patch: 0
qualifier: SNAPSHOT
commit: f24ec57d20a71c9de4274877a836fa90fbbb3d56

feedvalidator gives no errors and the same data files work fine with OTP 0.18.

@buma
Copy link
Contributor

buma commented Sep 3, 2015

This is probably caused by this commit: 92cbaed. Since trip 715615 has last stop duplicated and only the second has arrival/departure time. And since the last duplicated stop is removed last stop doesn't have arrival/departure time any more and runtime exception happens.

I'm working on a fix.

@buma
Copy link
Contributor

buma commented Sep 3, 2015

I think the main issue is typo in this line in previously mentioned commit:

-                    prev.setDepartureTime(st.getDepartureTime());
+                    st.setDepartureTime(st.getDepartureTime());

Previously departure time was copied from removed stop but now it isn't and st.setDepartureTime(st.getDepartureTime()); is basically useless operation.

But is there actually a reason for duplicated stops? Since most of them both have arrival and departure time. If we fix this typo times when vehicle is at the stop can be wrong since one stop-time is discarded.
For example:

Prev:StopTime(seq=44 stop=OMNITRANS_334 trip=OMNITRANS_742166 times=06:01:00-06:01:00) cur1:StopTime(seq=45 stop=OMNITRANS_334 trip=OMNITRANS_742166 times=06:03:00-06:03:00)
Prev:StopTime(seq=44 stop=OMNITRANS_334 trip=OMNITRANS_742165 times=21:12:00-21:12:00) cur1:StopTime(seq=45 stop=OMNITRANS_334 trip=OMNITRANS_742165 times=21:14:00-21:14:00)

In both times first time is arrival second is departure. According to this vehicle comes at the stop OMNITRANS_334 at 06:01:00 and then drives of at the same time. But is at the same stop at 06:03:00 with no stops in between. It would make more sense if the vehicle would be at the stop at 06:01:00 and would depart at 06:03:00.

@ardoi
Copy link
Author

ardoi commented Sep 3, 2015

Thanks for tracking down the issue! You're right that the duplicated stops situation is strange. I looked at Google and Here.com public transit directions and Google seems to take the 6:03 time for both departure and arrival and here.com the 6:01 time. I'm a total novice regarding GTFS, but would it make sense to combine the adjacent rows in stop_times.txt when parsing:

742166,06:01:00,06:01:00,334,44,,,,
742166,06:03:00,06:03:00,334,45,,,,

to show arrival time as 06:01:00 and departure as 06:03:00?

742166,06:01:00,06:03:00,334,44,,,,

Would it mess up the stop sequence?

@buma
Copy link
Contributor

buma commented Sep 3, 2015

Stop sequences need only to be increasing. Numbers can be missing.

2015-09-03 16:10 GMT+02:00 Ardo Illaste notifications@github.com:

Thanks for tracking down the issue! You're right that the duplicated stops
situation is strange. I looked at Google and Here.com public transit
directions and Google seems to take the 6:03 time for both departure and
arrival and here.com the 6:01 time. I'm a total novice regarding GTFS,
but would it make sense to combine the adjacent rows in stop_times.txt when
parsing:

742166,06:01:00,06:01:00,334,44,,,,
742166,06:03:00,06:03:00,334,45,,,,

to show arrival time as 06:01:00 and departure as 06:03:00?

742166,06:01:00,06:03:00,334,44,,,,

Would it mess up the stop sequence?


Reply to this email directly or view it on GitHub
#2113 (comment)
.

@abyrd abyrd closed this as completed Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants