-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Overall this is a minor issue only affecting a few lines, and it can be avoided by simply tagging correctly on OSM. With that said:
I'd noticed for a long time that the unelectrified San'in Main Line in Japan show up as electrified when and only when zoomed out, even though it's tagged electrified = no. I'd assumed initially that it was some weird tile caching issue, but it turns out the problem is actually bad tagging interacting with an oversight in logic in the code.
Specifically in electrification.mml, #railway_line_low (zoom ≤ 7) and #railway_line_med (zoom = 8) obtain their voltage values from simply rounding the raw tagged voltage from OSM. This contrasts with #railway_line_fill (zoom ≥ 9), which derives its voltage value from the output of the function railway_voltage_for_state. So if a main line tagged electrified = no also has a tagged voltage value, the black or brown line color for matching ["state"="no"], ["state"="deelectrified"], or ["state"="abandoned"] in electrification.mss gets overridden when zoom ≤ 8 by some later selector with higher specificity that are only supposed to match electrified tracks.
Since this happens when the track is mistagged, maybe the correct color is the default "no information" gray.



