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

White transit line not visible on map #810

Closed
ecgreb opened this issue Dec 20, 2016 · 9 comments
Closed

White transit line not visible on map #810

ecgreb opened this issue Dec 20, 2016 · 9 comments
Labels

Comments

@ecgreb
Copy link
Collaborator

ecgreb commented Dec 20, 2016

  • Device name: Google Pixel
  • Android Version: 7.1.1
  • App build number: 0.13.1
  • What did you expected to happen? Public transit line should be clearly visible
  • What happened instead? White transit line is hard to see over road network
  • Steps to reproduce:
  1. Enable debug menu by searching for "!!!!!!!!"
  2. Enable mock location and set coordinates to 60.18459, 24.9485027
  3. Search for "HSL" and select first result
  4. Click arrow to enter route preview mode
  5. Click transit icon to display multimodal route preview

At first glance it appears the tram leg is not drawn.

multimodal-1

However zooming in reveals the line is drawn but it is white.

multimodal-2

The JSON response confirms the white color for the tram line.

https://valhalla.mapzen.com/route?json={"costing":"multimodal","directions_options":{"language":"en-US","units":"miles"},"locations":[{"heading":"0","lat":"60.1846","lon":"24.9485"},{"city":"Helsinki","lat":"60.199102","lon":"24.940497","name":"HSL","state":"Uusimaa","street":"HSL"}]}&api_key=[YOUR_API_KEY]

"travel_type": "tram",
"travel_mode": "transit",
"arrive_instruction": "Arrive: 12:00 AM at Asemapäällikönkatu.",
"verbal_pre_transition_instruction": "Take the 9 toward Pasila.",
"verbal_post_transition_instruction": "Travel 7 stops.",
"instruction": "Take the 9 toward Pasila. (7 stops)",
"time": 681,
"type": 30,
"verbal_depart_instruction": "Depart at 12:00 AM from Kaarlenkatu.",
"length": 1.066,
"transit_info": {
  "operator_name": "HSL",
  "transit_stops": [{
                      "lon": 24.951485,
                      "type": "station",
                      "onestop_id": "s-ud9wru917e-kaarlenkatu",
                      "name": "Kaarlenkatu",
                      "lat": 60.186085,
                      "departure_date_time": "2016-12-20T19:1602:00"
                    }, {
                    // ...
                    }, {
                      "lon": 24.940496,
                      "lat": 60.198242,
                      "arrival_date_time": "2016-12-20T19:2402:00",
                      "type": "station",
                      "onestop_id": "s-ud9wrwc05t-asemapäällikönkatu",
                      "name": "Asemapäällikönkatu"
                    }],
  "operator_onestop_id": "o-ud9-helsinginseudunliikenne",
  "text_color": 0,
  "color": 16777215,
  "onestop_id": "r-ud9wr-9",
  "operator_url": "http:\/\/www.hsl.fi\/",
  "short_name": "9",
  "long_name": "Länsiterminaali-Rautatieasema-Pasila",
  "headsign": "Pasila"
},

The decimal value for "color" 16777215, translates to #FFFFFF hexidecimal color value.

@ecgreb ecgreb added the bug label Dec 20, 2016
@ecgreb
Copy link
Collaborator Author

ecgreb commented Dec 20, 2016

After further investigation it seems white is not the correct color for the HSL transit line.

Here is official documentation for HSL colors and implementation in Digitransit UI app provided by @tuukka (thanks!)

@dgearhart @drewda do we know where the color value is coming from in the response? Do we have incorrect data for HSL or is white the default value?

@dgearhart
Copy link
Member

@ecgreb the color values come from transitland
@gknisely are the defaults for line color and text color white and black respectively?

@gknisely
Copy link
Member

Yes. These are the defaults as described in the gtfs spec. https://developers.google.com/transit/gtfs/reference/routes-file
@ecgreb @dgearhart

@ecgreb
Copy link
Collaborator Author

ecgreb commented Dec 21, 2016

This seems less than ideal for our use case given the roads in bubble wrap are also white. Is it possible for us to change the default color in our implementation? cc @drewda

This is also something we could handle on the client side if updating the service is not a good option.

@tuukka
Copy link

tuukka commented Dec 23, 2016

I think Transitland shouldn't provide a color if none is specified in the source data. Otherwise, you don't know on the client side if a line is meant to be white or default color.

@drewda
Copy link
Member

drewda commented Jan 5, 2017

FYI, here's the data that Transitland has about the route used in that particular Valhalla response:

https://transit.land/api/v1/routes/r-ud9wr-9

{  
   "identifiers":[  
      "gtfs://f-ud9-helsinginseudunliikenne/r/1009"
   ],
   "imported_from_feeds":[  
      {  
         "feed_onestop_id":"f-ud9-helsinginseudunliikenne",
         "feed_version_sha1":"6f35eb7257af44b66838bb46d4b2286231df48bf",
         "gtfs_id":null
      }
   ],
   "created_or_updated_in_changeset_id":3590,
   "onestop_id":"r-ud9wr-9",
   "name":"9",
   "vehicle_type":"tram",
   "geometry":{  
    ...
   },
   "color":null,
   "tags":{  
      "route_url":"http://aikataulut.hsl.fi/linjat/fi/h9.html",
      "route_long_name":"Länsiterminaali-Rautatieasema-Pasila"
   },
   "stops_served_by_route":[  
    ...
   ],
   "operated_by_onestop_id":"o-ud9-helsinginseudunliikenne",
   "operated_by_name":"Helsingin seudun liikenne",
   "wheelchair_accessible":"all_trips",
   "bikes_allowed":"no_trips",
   "created_at":"2016-12-10T02:52:14.883Z",
   "updated_at":"2016-12-10T02:52:14.883Z",
   "route_stop_patterns_by_onestop_id":[  
      "r-ud9wr-9-242590-40454a",
      "r-ud9wr-9-301a50-721b34",
      "r-ud9wr-9-057a81-ced6e8",
      "r-ud9wr-9-d72931-59b6f5",
      "r-ud9wr-9-104312-33c0fd",
      "r-ud9wr-9-bae833-0726ef"
   ]
}

Note that "color":null because the source didn't specify a color.

When Valhalla fetches data from Transitland, it sets a default route color of white (https://github.com/valhalla/mjolnir/blob/04568ec48f9404ba1c459a24002ac55351cce26d/src/mjolnir/valhalla_build_transit.cc#L339).

A few options:

@ecgreb
Copy link
Collaborator Author

ecgreb commented Jan 10, 2017

Thanks for the info @drewda.

I don't hate the idea of Valhalla returning null when the route line color is not specified that would allow us to distinguish between "no color available" and an actual white transit line (if this exists) so we don't override valid data with a local default color. I also realize why this is not a trivial change when you have to consider existing clients.

As for adding the visual outline this would require updates to the stylesheet and possibly Tangram ES so would require some coordination across teams to implement on mobile but could also be a reasonable option. I would be interested to get thoughts from @nvkelso and @matteblair on this approach.

@matteblair
Copy link
Member

Tangram-es supports styling polylines with "outlines", so that's a possibility. The question remains whether that is the most desirable option, visually.

@sarahsnow1
Copy link
Member

Closing in favor of https://github.com/transitland/transitland/issues/255, #823

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants