Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

HART GTFS error - java.lang.IllegalStateException: arrival time is less than previous departure time #9

Closed
barbeau opened this issue Nov 13, 2012 · 1 comment

Comments

@barbeau
Copy link
Member

barbeau commented Nov 13, 2012

Public HART GTFS data hosted at http://www.gohart.org/google/ has problems with the GTFS arrival/departure times, and therefore OBA won't build a bundle based on this data.

Below is email chain conversation with HART describing the problem.

As of Nov. 13, 2012, HART is doing further post-processing of the GTFS data and sending us the updated GTFS data that works with OBA. This works as a stop-gap measure to provide data that works with OBA for testing, but for production HART needs to be able to automatically produce the clean GTFS data so the bundle building process can be automated.


I have attached an updated file that should work for you.


Tim,
Wow, that’s lots of instances. Thanks for checking this out.

I believe GTFS spec itself does actually require seconds in the time format:
https://developers.google.com/transit/gtfs/reference#stop_times_fields

Its requires “HH:MM:SS” format. Do you mean that the Trapeze output data in GTFS format doesn’t contain seconds?

Per this same link under “arrival_time” and “departure_time”, the GTFS spec actually says that you shouldn’t interpolate times for stops in between:
“You must specify arrival times for the first and last stops in a trip. If this stop isn't a time point, use an empty string value for thearrival_time and departure_time fields. Stops without arrival times will be scheduled based on the nearest preceding timed stop. To ensure accurate routing, please provide arrival and departure times for all stops that are time points. Do not interpolate stops.”

So, I think we will probably be safest for both OBA and Google Transit if we follow the GTFS spec, if possible given the Trapeze software.

1-3 days if fine, and let me know if you want to discuss this given the above recommendations in GTFS.

Sean


Sean,

Just an FYI, I found 72,384 of 216,432 instances of the situation that you mention.

I believe what you are seeing in the data is a by-product of several processes. At the high level, the GTFS contains times without seconds. At a lower level, the data comes from Trapeze and stop times are specified for timepoints only. Times for stops in between are interpolated/ calculated.

For OBA I will have to add another procedure to the Google data extraction process to provide stop_times.txt in hh:mm:ss format. It may take 1- 3 days to get a new file depending on work involved for the ITS real-time data queries.


Tim,
Here’s the google_transit.zip file I’m using, which I downloaded yesterday. Its renamed, since I have several GTFS feeds in the same folder.

Unfortunately the OneBusAway (OBA) graph builder stops after encountering an error, so this is the only error I’ve seen so far (graph building is the first step when OBA compiles the GTFS data into an object that used in the server). If you want to give it a shot yourself and see the output of any errors, download the WAR file from this link:
http://nexus.onebusaway.org/service/local/artifact/maven/content?r=public&g=org.onebusaway&a=onebusaway-quickstart-assembly&c=webapp&e=war&v=1.0.7

Then open the command line to the directory where the WAR file is located and enter:
java –Xmx1G –server –jar onebusaway-quickstart-assembly-1.0.7-webapp.war

You’ll be prompted to enter an empty directory (e.g., C:\OneBusAway\quickstart) where the compiled object will be stored, and the GTFS zip file to be loaded (this is the HART GTFS). When prompted select “Build transit bundle only”. You’ll need Java JDK 1.6 installed to do this.

If you can’t run OBA graph builder yourself, just sent the updated GTFS zip file to me and I’ll run it through again.

I don’t think there are any restrictions on the number of schedule periods in the GTFS feed, although the feed does need to have dates that cover the current period (i.e., today’s date). If you want, send me the other GTFS zip file and I’ll run it through and see what it says.

Sean


Sean,
I’m surprised to see this error. The Google Transit upload process include a data checker prepared by Google. The tool has caught these errors in the past. I will be sure to notify the support team of your findings.

Can you provide me the complete exceptions list so I can investigate them? Also please send me the google_transit.zip file you are working with.

For One Bus Away do you need a GTFS containing only one schedule period? The reason I ask is that I published another version with a single schedule on July, 9. It will likely have the same errors, however.


Tim,
I’m attempting to input HART’s GTFS data into the OneBusAway system (we require GTFS data in addition to real-time info), and I’m getting an error:
java.lang.IllegalStateException: arrival time is less than previous departure time for stop time with trip_id=Hillsborough Area Regional Transit_808200 stop_sequence=4

So I cracked open the GTFS zip file and took a look at the stop_times.txt file. I tried to send a in Excel format, sorted by trip_id and then by stop_sequence (both increasing), but it kicked it back due to size. So, you’ll need to use your local GTFS copy as a reference.

If you do a search for trip_id “808200”, you should find the stop_times for that trip. Each record indicates a stop that a bus makes, and has both an arrival_time (i.e., time the bus arrives at that stop) and departure_time (i.e., time the bus departs from that stop).

Here are the first few records from trip 808200:
trip_id arrival_time departure_time stop_id stop_sequence
808200 17:00:00 17:00:00 6643 1
808200 17:00:00 17:00:00 6651 2
808200 17:01:00 17:01:00 7042 3
808200 17:01:00 17:01:00 6661 4

So the first two stops are from bus stop:
6643 Livingston Av @ Campus Lodge Apts 28.08989 -82.4307

to bus stop:
6651 Sinclair Hills Rd @ Livingston Av 28.09156 -82.4313

So, the bus is departing from the first stop at the exact same time it is arriving at the second stop. There should be some time elapsed between the two stops to be logically correct.

Here’s a Google Map illustrating these two stops (bus travels from green to red):
https://maps.google.com/maps/ms?msid=210487090194159379832.0004c52139232d199ac3a&msa=0&ll=28.091414,-82.432036&spn=0.007156,0.009645

Same behavior repeats in this and a few other trips. Other trips seem to be fine, with no repetition of arrival/departure times at sequential stops.

Sean

@barbeau
Copy link
Member Author

barbeau commented Mar 8, 2013

HART has fixed this issue, and the data being hosted on their website for Google Transit can now be used for OneBusAway as well. Below is the email exchange with HART.


Tim,
Thanks! I updated OneBusAway last night, and the schedule is now good through May 25th, as can be seen in this schedule display:
http://onebusaway.forest.usf.edu/onebusaway-webapp/where/standard/schedule.action?id=Hillsborough%20Area%20Regional%20Transit_3105

Thanks again for putting this data together!

So, going forward, we’ll use the same http://www.gohart.org/google/ data that is used by Google Transit for OneBusAway, which covers both the current and next schedule period.

Thanks,
Sean

From: Tim Wicktor [mailto:[email protected]]
Sent: Friday, March 01, 2013 3:41 PM
To: Steve Feigenbaum; John Creaton; Shannon Haney; Barbeau, Sean
Cc: Rick Fitz-Gordon
Subject: GTFS

The GTFS for the March 17 mark-up has been posted to Google and to the HART web site. The dataset can be downloaded from http://www.gohart.org/google/.

The version posted contains data for the November 2012 markup to meet the needs of the Google Transit program. The format of the time fields in the stop_times.txt file have been changed to show seconds to meet the need of the OneBus Away project.

To address an anomaly discovered by Merita in the past I will be posting another dataset Monday, March 4, 2013 containing only the March 2013 schedule data.

Let me know if you have questions.

Tim Wicktor
Programmer Analyst - DBA
HART
1201 East 7th Avenue
Tampa, FL 33605
Tel: (813) 384-6351
FAX: (813) 384-6278
[email protected]

NOTICE: Hillsborough Transit Authority (HART) is a public agency subject to public records law. E-mail messages are covered under such laws and thus are subject to disclosure. (Florida Statutes, Chapter 119)

  • Go Green! Please don't print this e-mail unless you really need to. Thanks!

@barbeau barbeau closed this as completed Mar 8, 2013
barbeau pushed a commit that referenced this issue May 9, 2018
v4 of user properties including enable/disable user (not merely delete)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant