Skip to content

'siri_ride_journey_ref' not unique : 'siri_ride_journey_ref' == " 2022-03-06-0" #16

Description

@nachman-shelef

I tried using 'siri_ride_journey_ref' as a unique identifier of a "trip" in the df of all locations in one day (2022-03-06) that I created... however, I found that many siri records (75,852 of 4,718,821 ) have 'siri_ride_journey_ref' == " 2022-03-06-0" - so not unique

to collect all locations for one day, I loop through all route_id s and make the following request :

(the below is for route_id = '1877' because it is one of the route_IDs that have 'siri_ride_journey_ref' == " 2022-03-06-0" in the response)

route_id = '1877'
rt_date = '20220306'
date_yyyy = int(rt_date[0:4])
date_mm = int(rt_date[4:6])
date_dd = int(rt_date[6:])

siri_vehicle_locations_df = pd.DataFrame(stride.iterate('/siri_vehicle_locations/list', {
'siri_routes__line_ref': route_id,
'siri_rides__schedualed_start_time_from': datetime.datetime(date_yyyy, date_mm, date_dd, tzinfo=tz.gettz('Israel')),
'siri_rides__schedualed_start_time_to': datetime.datetime(date_yyyy, date_mm, date_dd, tzinfo=tz.gettz('Israel'))+datetime.timedelta(days=1),
'order_by': 'recorded_at_time desc',
'limit': -1
}, limit=50000))

print(siri_vehicle_locations_df )

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions