Skip to content

Commit

Permalink
For unknown route_type values, use int instead of str
Browse files Browse the repository at this point in the history
When the user's data has route_type values that don't match the ones listed in the GTFS spec, my code sets the route_type to 100 as just a random value to track them.  It was setting it to a string value, '100', instead of an integer, and this caused these routes to get ignored later when generating polylines.
  • Loading branch information
mmorang committed Oct 22, 2018
1 parent e4d81b9 commit 7f53a07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generate-GTFS-shapes/scripts/Step1_MakeShapesFC.py
Expand Up @@ -1303,7 +1303,7 @@ def get_route_info():
route_type = route[5]
route_type_text = route_type_dict[int(route_type)]
except:
route_type = '100'
route_type = 100
route_type_text = "Other / Type not specified"
RouteDict[route[0]] = [route[1], route[2], route[3], route[4], route_type,
route[6], route[7], route[8],
Expand Down Expand Up @@ -1411,4 +1411,4 @@ def append_existing_shape_to_fc(shape, StopsCursor, route=None):
# Add the polyline feature to the output feature class
StopsCursor.insertRow((polyline, shape, route,
route_short_name, route_long_name, route_desc,
route_type, route_type_text,))
route_type, route_type_text,))

0 comments on commit 7f53a07

Please sign in to comment.