openstreetmap-carto icon indicating copy to clipboard operation
openstreetmap-carto copied to clipboard

[WIP] Unify dasharray-based highway=* rendering

Open sommerluk opened this issue 2 years ago • 7 comments

Unify dasharray-based highway=* rendering

Currently, we have a couple of highway=* values for which we use a dasharray-based rendering: bridleway, cycleway, footway, path, track, steps. Steps is a special case.

We have many different dasharry patterns which are difficult to distinguish. Furthermore, they do not represent the same secondary tags on different primary tags: on trank, it’s six different values for tracktype (one for each tracktype and “no value”), on bridleway it’s nothing, and on footway and cycleway, it’s three different values for surface (upaved, unpaved, no value). That’s highly confusing. Having so many pattern makes them difficult to distinguish.

We could try to unify the other dasharray-based renderings:

  • Use only three different patterns on all these values: paved, no value, unpaved.
  • Use the same line width (on the same zoom level) on all these highways.
  • Use exactly the same pattern values on all these highways.

This would also simplify our code base. It would also be conforming to what we do yet on roads (paved/unpaved as secondary tag). This would make the map more readable.

The question is if a unified line width would work well-balanced when some colors like red (footway) or blue (cycleway) get more attention than brown (track).

Fixes #4322 Closes #4692 (mutually exclusive)

This isn’t a ready-made PR, but rather a sort of mock-up for discussion, if this approach could work.

Test rendering with links to the example places:

Before old

After new

sommerluk avatar Jan 19 '23 13:01 sommerluk

Some comments:

  • the choice of different line widths for footway and cycleway was a deliberate one to compensate for the significantly different weights of the colors used in most contexts. See #1793 for details.
  • I don't think unifying track and footway/cycleway/path so they are only differentiated by color is a viable approach. These are too different in real world semantics. I would be very much in favor of the dashing pattern and what they indicate following the same principle (i.e. paved/unpaved/unknown) across all of these - but a different scale in both width and dashing for the single track paths and for tracks seems advisable.
  • It might be worth looking if the other issues we have about path rendering (#1748, #1765, #1793) could be improved with such a change. I continue to be in favor of the 'bigger' solution to this - that is getting rid of the purple boundaries and moving cycleways to use purple color - which would allow then to use a non-dashed line signature at the low zoom levels, which means a much cleaner map image overall (see https://imagico.de/blog/en/drawing-the-lines/ or here vs. here) - but i am not tied to that, gladly would see a different approach leading to improvements.

imagico avatar Jan 19 '23 15:01 imagico

@imagico Given that you have implemented this yet in your style, and it seems to work fine, could you make a PR?

sommerluk avatar Jul 31 '23 15:07 sommerluk

I am not sure we have consensus to get rid of the purple boundaries. Previous discussion on this was non-conclusive - see #3489.

Also note that in the AC-Style i stopped rendering nature reserves. I have also been thinking of in addition also not rendering subnational boundaries any more. This would put a much clearer focus in the map on the verifiable geography.

If there is consensus now to move anything that cuts this Gordian knot in terms of colors that would make the AC-style road color changes feasible i would gladly make a PR.

imagico avatar Jul 31 '23 17:07 imagico

[matching screenshots at Z16]

image

image

More to provide food for discussion rather than proposing this as a solution, here's a take on unified dash patterns. This uses casing dash patterns to show tracktype and unifying highway=service (minor) and highway=track (both involve two-axled vehicles after all). [This allows legal state (e.g. the red dashing for public footpaths) to be shown, where a track is also a right of way.] Paths / footways are then brown dashed (with the same scheme, just different colours, for bridleways and cycleways).

This does involve a fair bit of lua wrangling to generate a proxy tracktype (which determines the dashing), typically from surface. Default dashing is used when a tracktype is not obvious, avoiding the need for an "unknown" styling.

Overall the style reflects UK Ordnance Survey mapping, and so may not translate well to other places.

Note the lack of purple admin boundaries!

dch0ph avatar Dec 30 '23 14:12 dch0ph

Without knowing exactly what the different line signatures in your example are meant to depict - a dashed casing is not going to work because we already use that for our tunnel rendering.

imagico avatar Dec 30 '23 14:12 imagico

Sure, it would need to be part of an overall design:

image (grey fill and short dash pattern used for tunnels)

compared to: image

Personally I find the former easier to "read" (agricultural track passing under a railway line, with highway=path leading off).

As stated, I'm not proposing this as a way forward, just noting that a coherent design is possible.

dch0ph avatar Jan 03 '24 19:01 dch0ph

Just to make this clear: Showing a mock-up of a design idea in a very specific context at a specific scale is not a demonstration that this is a workable approach in general.

In any case this is the wrong place for such a suggestion.

Exploring new design concepts to improve our rendering of roads would be valuable. But because of the large number of design variants, the very diverse geometric contexts this needs to work in and the need to maintain an intuitive level of consistency across the whole road system this is not an easy matter.

imagico avatar Jan 03 '24 20:01 imagico