-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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.