OneBusAway / onebusaway-ios

OneBusAway for iOS, written in Swift.
Other
82 stars 33 forks source link

Occupancy Status #34

Closed aaronbrethorst closed 3 years ago

aaronbrethorst commented 5 years ago

~We should first wait for the current efforts around improving this functionality at the GTFS spec level to come to rest, and then implement whatever is defined there after it exits the experimental stage.~

This is ready to go. Needs a design, but otherwise can be worked on.

Output for api/where/arrivals-and-departures-for-stop/1_8407.json:

1_8407.json.zip

Validation can be done on WMATA's servers.

Corresponding Android issue: https://github.com/OneBusAway/onebusaway-android/issues/1059

barbeau commented 3 years ago

@aaronbrethorst Here's what the OBA Android UI looks like with live WMATA data (designed way back in 2018) using new code in WIP PR https://github.com/OneBusAway/onebusaway-android/pull/1060:

image

For WMATA, MANY_SEATS_AVAILABLE is 1 person icon, FEW_SEATS_AVAILABLE is 2 person icons, and FULL is 3 person icons.

Note that this may need to be adjusted for other agencies depending on which GTFS-RT OccupancyStatus enums they choose to publish (this is a whole thing in the spec still).

To keep the UI from looking too much like a Christmas tree, I'm using green for shading the 1 and 2 person icons, and red for the 3 person icons. I tried adding a yellow for 2 persons back when I first implemented this, but the color on the screen really starts to get overwhelming. Historical occupancy (not published by WMATA) would show up as gray, just like scheduled arrivals. There is an "About occupancy" menu item when you tap on each arrival list item available that explains this.