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

Support for non time points, gtfs2rrrr error 'Negative times' #193

Open
BennyKJohnson opened this issue Apr 16, 2015 · 2 comments
Open

Support for non time points, gtfs2rrrr error 'Negative times' #193

BennyKJohnson opened this issue Apr 16, 2015 · 2 comments
Assignees

Comments

@BennyKJohnson
Copy link

Hi,
when parsing the Sydney Transport feed through gtfs2rrrr, an exception was raised "ValueError: Negative times". I worked out this error was due to the Sydney GTFS feed containing empty arrival and departure times for some of the stop times (None < 0 is true). According to the GTFS specifications it is valid to have empty arrival and departure times as long as they are not time points.
https://developers.google.com/transit/gtfs/reference#stop_times_fields

I fixed this issue by storing the last valid arrival and departure times and substituting those values if arrival or departure time was null (none). This was a quick fix, though it would be beneficial to others if there was improvements made to the script to allow stop_times without times.

Trace:

    Traceback (most recent call last):
    File "gtfs2rrrr.py", line 109, in <module> main()
    File "gtfs2rrrr.py", line 102, in main
    tdata = convert(gtfsdb)
    File "gtfs2rrrr.py", line 80, in convert
    vj.add_stop(stop_id,arrival_time,departure_time,forboarding=(pickup_type != 1),foralighting=(drop_off_type != 1))
  File "model/transit.py", line 199, in add_stop
    raise ValueError('Negative times')
    ValueError: Negative times

Thanks

@skinkie
Copy link
Contributor

skinkie commented Apr 16, 2015

We want to have a nice interpolated value here. Prererably taking the shape distance in account too.

@koch-t
Copy link
Contributor

koch-t commented Apr 16, 2015

https://groups.google.com/forum/#!search/shape_dist_travelled/transit-developers/KH8Ug66A7fk/cpBelgYovUsJ
I would give a -1 on using shape_dist_travelled for anything. Use as-the-crow-fly distances or if you really want it get the "real" distance via the shape itself

@skinkie skinkie self-assigned this Apr 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants