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

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

Open
nachman-shelef opened this issue Aug 18, 2022 · 0 comments
Assignees

Comments

@nachman-shelef
Copy link

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 )

@OriHoch OriHoch self-assigned this Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants