OneBusAway / onebusaway-android

The official Android app for OneBusAway
http://www.onebusaway.org/
Other
474 stars 291 forks source link

Display different icon for rail stops #63

Open bbodenmiller opened 11 years ago

bbodenmiller commented 11 years ago

would like to see the rail stops display a different icon like oba iphone does.

barbeau commented 11 years ago

@bbodenmiller how does OBA iPhone identify which stops should get the rail icon? Is it just based on the route_type from GTFS data?

Route classifications in GTFS are here: https://developers.google.com/transit/gtfs/reference#routes_fields

0 - Tram, Streetcar, Light rail. Any light rail or street level system within a metropolitan area. 1 - Subway, Metro. Any underground rail system within a metropolitan area. 2 - Rail. Used for intercity or long-distance travel. 3 - Bus. Used for short- and long-distance bus routes. 4 - Ferry. Used for short- and long-distance boat service. 5 - Cable car. Used for street-level cable cars where the cable runs beneath the car. 6 - Gondola, Suspended cable car. Typically used for aerial cable cars where the car is suspended from the cable. 7 - Funicular. Any rail system designed for steep inclines.

We just had a discussion in Tampa for handling stop icons differently for BRT vs. normal bus routes (since the stations and buses are branded differently), but the problem for this is that there isn't a separate GTFS route type for BRT.

In general, we should think about how to handle both branded (e.g., Tampa Metrorapid) and un-branded (bus vs. rail) logos for all apps.

paulcwatts commented 11 years ago

The last time I looked at the iOS code, I think there was some logic in to look at the routes served at each stop and make a determination which icon to use based on a "priority" order:

  1. Ferry
  2. Heavy rail
  3. Light rail/Metro
  4. Bus

I think the only places where these would overlap would be in the Seattle transit tunnel, where light rail shares stops with buses.

It's been something I've wanted to do, I just never got around to making the art for each stop type.

barbeau commented 11 years ago

@paulcwatts re: supporting branded icons, such as that shown in the attached image for BART on Google Maps - do you think the best strategy would be to bundle the icons with the app as resources, with a fixed mapping between icon sets and region IDs?

An alternate approach would be to fetch dynamically (maybe using a new icon_url field from GTFS), but this seems slow and prone to failure on first start-up, unless we have a background fetch mechanism that first shows the default icon and then changes to branded icons after they are downloaded. Advantage would be adding new brands could happen without rebuilding and redeploying the app.

image

paulcwatts commented 11 years ago

Is this functionality supported in the OBA API? I think fetching dynamically would be the best way. You could either show a default icon first, or fetch it and only show the default icon if fetching failed. There are plenty of ways to cache icons so you don't have to always refetch them. It's not really that error prone, plenty of apps do this stuff all the time.

barbeau commented 11 years ago

No such icon_url support in OBA or GTFS at the moment. I looked at BART's GTFS data and they don't include any such links, so I assume they are just giving the icons to Google behind-the-scenes. So, we could eventually propose this as a GTFS extension. We'll also need to figure out where this field fits best (probably stops.txt?).

I'll get HART's feedback on this and see if they want this feature bad enough to commit to maintaining a GTFS feed with an icon_url included.

Assuming we use GTFS to hold this info, I guess we will need a single set of icons for all mobile platforms.

@bbodenmiller What are the dimensions/formats of the stop icons in the OBA iPhone app?

@mbraude What are the dimensions/formats of the stop icons in the OBA WP and Win8 apps?

@alanborning @kariwatkins Do you think there would be interest from Seattle agencies and MARTA in custom branded icons for stops/stations (see example screenshot from Google Maps on Github issue page)?

mbraude commented 11 years ago

The icons are in png format but need to be specific dimensions (I believe 28x28 for win8, not sure about win phone).

Branding on the stop icons sounds...tricky., because of the sizes and formats for each app. I thought it would be easier to brand based on the region the app was talking to, or the agency that operated the bus whose route we were displaying. Things like theme colors, etc., would be easier to change dynamically.

bbodenmiller commented 11 years ago

I think agency specific branding might be a bit more than we should take on initially. Also some agencies don't allow you to use their logos unless it is their official app, etc.

barbeau commented 10 years ago

Icons used in OBA iOS can be downloaded from: https://github.com/OneBusAway/onebusaway-iphone/tree/develop/Libraries/aaronbrethorst-onebusaway-iphone-common-fa9a21b/Resources/MapIcons

barbeau commented 9 years ago

Mentioned in https://github.com/OneBusAway/onebusaway-android/issues/155#issuecomment-69586111:

Looking at the REST API response for stop 99905, "train" routes in Puget Sound have type=0:

agencyId: "40",
color: "",
description: "LINK to Sea-Tac",
id: "40_100479",
longName: "",
shortName: "LINK",
textColor: "",
type: 0,
url: "http://www.soundtransit.org/Schedules/ST-Express-Bus/599"

...and bus routes have type=3:

agencyId: "1",
color: "",
description: "Tukwila - E Marginal - CBD",
id: "1_100023",
longName: "",
shortName: "124",
textColor: "",
type: 3,
url: "http://metro.kingcounty.gov/schedules/124/n0.html"

So, "train" is classified under GTFS route_type category for:

Tram, Streetcard, Light rail. Any light rail or street level system within a metropolitan area.

devinbraun commented 5 years ago

Bumping this issue as this is an important icon distinction for user experience. In the attached screenshots of Android OBA for a medium- and large-size transit centers, it can be difficult to ascertain which stops are for light rail and which are for buses. You can see the underlying Google Maps differentiating icons.

Medium-size transit center screenshot_20181213-075557

Large-size transit center screenshot_20181213-075911

barbeau commented 5 years ago

@devinbraun Thanks for the bump. Would you be able to give me the stop IDs for the rail stops shown above in San Diego? It would be easiest to implement/test a solution with real data.

For design, I think we could do something similar to Google, where we have a green square with a white rail icon in the middle.

devinbraun commented 5 years ago

Sure 12th & Imperial Transit Center Bus: 91101, 91102, 70009, 88899 Light Rail: 75102, 75103

Old Town Transit Center Bus: 94019, 94020, 94021, 94022, 94023, 94024, 94025, , 94027, 94030, 94034, 96034 Light Rail: 75042, 75043 Heavy Rail (NCTD): 28006

barbeau commented 5 years ago

Thanks @devinbraun!

For our future use, here's a Gist with the REST API responses for arrivals-and-departures-for-stop for three stops (bus, light rail, heavy rail): https://gist.github.com/barbeau/a22effda5532e91e6e9c5c08839455c8

I still need to add the stops-for-location responses that include these stops. EDIT - I just added this at the bottom - the route types are visible in the references section at the bottom.