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

Unelectrified tracks with errant voltage tag render as electrified for zoom ≤ 8 #130

Open
epimorphic opened this issue Aug 11, 2024 · 0 comments

Comments

@epimorphic
Copy link
Contributor

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.

Screenshots

San'in Main Line, zoom 8 vs 9
Screenshot 2024-08-11 at 12-56-40 OpenRailwayMap
Screenshot 2024-08-11 at 12-57-34 OpenRailwayMap

Línea Central Sur, zoom 8 vs 9
Screenshot 2024-08-11 at 12-58-15 OpenRailwayMap
Screenshot 2024-08-11 at 12-59-14 OpenRailwayMap

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

No branches or pull requests

1 participant