Skip to content

Simplify enum for occupancy, add occupancy_percentage#2

Merged
gcamp merged 12 commits intooccupancy_v2from
draft/occupancy_v2
Apr 9, 2020
Merged

Simplify enum for occupancy, add occupancy_percentage#2
gcamp merged 12 commits intooccupancy_v2from
draft/occupancy_v2

Conversation

@gcamp
Copy link
Member

@gcamp gcamp commented Apr 8, 2020

OccupancyStatus was added 6 years ago as an experimental field to the GTFS-rt spec. Multiple producers and consumers have adopted the value but the implementation has currently some problems.

The enum of occupancy_status has 7 values, however we've seen that the range of values is not used in practice. We've seen consumer mostly use 3 values to represent the entire range of occupancy. For example :

  • New South Wales buses only use the MANY_SEATS_AVAILABLE, FEW_SEATS_AVAILABLE and STANDING_ROOM_ONLY.
  • Some New South Wales trains uses all the values available except EMPTY and NOT_ACCEPTING_PASSENGERS. However, the agency suggest to never display more than 3 textual values for the consumer facing message. More granularity can be provided with colors.
  • MTA NYC has limited availability of the feature in their feed but do use FEW_SEATS_AVAILABLE, STANDING_ROOM_ONLY, FULL.

For this reason I would suggest to only give 3 values in the enum. FEW_SEATS_AVAILABLE, STANDING_AVAILABLE, FULL. The naming changed slightly to reflect the same 3 values available in SIRI.

However, we do lose a lot of granularity of how fine the occupancy value can be provided. To alleviate this problem I would suggest to add a second value occupancy_percentage to give a more accurate value of occupancy.

It would be percentage value representing the degree of passenger occupancy of the vehicle. The values are represented as an integer without decimals. 0 means 0% and 100 means 100%. The value 100 should represent the total maximum occupancy the vehicle was designed for, including both seated and standing capacity. It is possible that the value goes over 100 if there are currently more passengers than what the vehicle was designed for.

It was decided to have both values because they fulfill two different purpose. occupancy_status is provided to give a understandable value for the user (STANDING_ROOM_ONLY is way more understandable for a user than 50% full). occupancy_percentage is provided to give more granular data.

gcamp and others added 5 commits April 8, 2020 17:03
Co-Authored-By: Juan <juanborre@users.noreply.github.com>
Co-Authored-By: Juan <juanborre@users.noreply.github.com>
Co-Authored-By: Juan <juanborre@users.noreply.github.com>
Co-Authored-By: Juan <juanborre@users.noreply.github.com>
Copy link

@juanborre juanborre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👏

@gcamp gcamp merged commit 4c3c7ce into occupancy_v2 Apr 9, 2020
@gcamp gcamp deleted the draft/occupancy_v2 branch April 9, 2020 12:45
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

Successfully merging this pull request may close these issues.

3 participants