Skip to content

Commit

Permalink
Re-on fix GeoJSON
Browse files Browse the repository at this point in the history
reducing to two digits of trip_id, assuming there may be more that 10 and less than 100 on the same route at the same time
  • Loading branch information
vingerha committed Dec 4, 2023
1 parent a1e3341 commit 71ab5df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/gtfs2/gtfs_rt_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ def get_rt_vehicle_positions(self):
geojson_element["geometry"]["coordinates"] = []
geojson_element["geometry"]["coordinates"].append(vehicle.position.longitude)
geojson_element["geometry"]["coordinates"].append(vehicle.position.latitude)
geojson_element["properties"]["id"] = str(vehicle.trip.route_id) + "(" + str(vehicle.trip.direction_id) + ")" + str(vehicle.trip.trip_id)[-3:]
geojson_element["properties"]["title"] = str(vehicle.trip.route_id) + "(" + str(vehicle.trip.direction_id) + ")" + str(vehicle.trip.trip_id)[-3:]
geojson_element["properties"]["id"] = str(vehicle.trip.route_id) + "(" + str(vehicle.trip.direction_id) + ")" + str(vehicle.trip.trip_id)[-2:]
geojson_element["properties"]["title"] = str(vehicle.trip.route_id) + "(" + str(vehicle.trip.direction_id) + ")" + str(vehicle.trip.trip_id)[-2:]
geojson_element["properties"]["trip_id"] = vehicle.trip.trip_id
geojson_element["properties"]["route_id"] = vehicle.trip.route_id
geojson_element["properties"]["direction_id"] = vehicle.trip.direction_id
Expand Down

0 comments on commit 71ab5df

Please sign in to comment.