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

Permanent solution for counting GTFS-RT occupancy status #289

Open
teemu8655 opened this issue May 23, 2023 · 1 comment
Open

Permanent solution for counting GTFS-RT occupancy status #289

teemu8655 opened this issue May 23, 2023 · 1 comment
Assignees
Labels
ADO Will be moved to ADO MOVED TO ADO Is moved to ADO board

Comments

@teemu8655
Copy link

teemu8655 commented May 23, 2023

We need a permanent, solid solution for vehicle capacities in Transitdata to avoid unnecessary manual work. Vehicle capasities are needed to calculate the degree of filling in the busses in real time to generate GTFS-RT occupancy status.

At the moment we use a list on vehicles and capasities per vehicle. Vehicle capasities are listed in transitdata-dev.yml file under topic transitdata_partial_apc_expander_combiner. If no value is provided, default value of 78 is used.

We want to change to more solid solution so that we don't need to update individual vehicles to the file when more busses are added to send APC data.

Solid solution could be to query vehicle information from Reittiloki database or Reittiloki graphql interface and use just the vehicle type to calculate the degree of filling based on the static passenger capacities per vehicle type:

Vehicle type,seats,standing_seats,total_capacity
A1,32,24,56
A2,40,27,67
C,49,29,78
D,52,53,105
MA,16,3,19
MB,16,3,19

GTFS-RT conversion:
EMPTY: 0 matkustajaa – 30% istumapaikoista käytössä
MANY_SEATS_AVAILABLE: 30% istumapaikoista käytössä – 70% istumapaikoista käytössä
FEW_SEATS_AVAILABLE: 70% istumapaikoista käytössä – 70% maksikuormasta (Oletuksena että aina joku seisoo eli paikkoja saattaa olla)
CRUSHED_STANDING_ROOM_ONLY: 70% maksimikuormasta – 100% maksimi paikkaluvusta
FULL: yli 100% Maksimi paikkaluvusta

Use this new conversion in dev and prod.

@teemu8655 teemu8655 changed the title Update vehicle capasities to PROV env Vehicle capacities in GTFS-RT May 23, 2023
@teemu8655 teemu8655 changed the title Vehicle capacities in GTFS-RT Permanent solution for counting GTFS-RT occupancy status May 23, 2023
@teemu8655 teemu8655 added the ADO Will be moved to ADO label May 23, 2023
@LofhJann
Copy link

LofhJann commented Sep 14, 2023

Branch in progress: https://github.com/HSLdevcom/transitdata-partial-apc-expander-combiner/tree/vehicle-capabilities-from-database

Still todo:

Format for "file" should be [["0018/00710",67]] where 0018 (if under 4, pad with zeroes) is operator_id, 00710 is vehicle_id (if under 5, pad with zeroes) and 67 is total_capacity (get

If "file" doesn't contain vehicle use default value (as currently)

Remove all unnecessary test code and typescript ignores, code should work without them.

Remember the file should be written every startup.

@teemu8655 teemu8655 added the MOVED TO ADO Is moved to ADO board label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADO Will be moved to ADO MOVED TO ADO Is moved to ADO board
Projects
None yet
Development

No branches or pull requests

3 participants