nickolasclarke / dispatch

A discrete-event simulation (DES) model for simulating deployment of EV bus fleets, using GTFS data
2 stars 0 forks source link

parse_gtfs crashes when generating road segments #14

Closed nickolasclarke closed 4 years ago

nickolasclarke commented 4 years ago

output when attempting to parse the latest minneapolis gtfs feed.

Traceback (most recent call last):
  File "parse_gtfs.py", line 234, in <module>
    road_segs, seg_props = GenerateRoadSegments(ptg.load_geo_feed(feed_file))
  File "parse_gtfs.py", line 202, in GenerateRoadSegments
    shape_props['distance'] = [[SegLength(*x) for x in x] for x in shape_props['seg_hash']]
  File "parse_gtfs.py", line 202, in <listcomp>
    shape_props['distance'] = [[SegLength(*x) for x in x] for x in shape_props['seg_hash']]
  File "parse_gtfs.py", line 202, in <listcomp>
    shape_props['distance'] = [[SegLength(*x) for x in x] for x in shape_props['seg_hash']]
  File "parse_gtfs.py", line 184, in SegLength
    xd = p1[0]-p2[0]
TypeError: 'float' object is not subscriptable
r-barnes commented 4 years ago

x should be a 4-tuple of floats which gets unpacked to form the arguments of SegLength. It looks as though it's not getting passed in that way for some reason.