Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

[roads] Improve rendering of street names #2991

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

[roads] Improve rendering of street names #2991

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

Reporter: stanton
[Submitted to the original trac issue database at 10.32pm, Friday, 21st May 2010]

Mapnik currently seems to render street names once in the middle of each piece of way, with various undesirable effects such as

  • names not rendering at all if the road is split up in multiple short ways (which may happen for multiple reasons, such as different relation memberships or attributes applying just to one part of the way, such as speed limits)
  • names wrapping around angles at strange places when there is enough space to render the name in a straight line
  • names of very long roads appearing just once, making it unclear where the boundary between two differently named sections of the same road (if any) is
  • the name rendering twice if the road is made up of two separate ways which blend into each other when rendering

This could be remedied by the following:

  • Merge all pieces of road if they have the same name and highway attributes and are either joined (i.e. share a common node) or blend into each other (zoom level dependent); render the name for the entire length of the combined road
  • If the resulting road is very long, repeat the names along its length multiple times:
    • at each end and
    • optionally in between where other roads cross, to make it clear the road continues beyond the junction
  • Where possible, pick an almost straight section (defined by minimum angle at a single point and/or minimum curve radius for consecutive points) and render the name there. Failing that, consider splitting the name string up at spaces, hyphens etc. (i.e. by the same rules that apply for line breaks) and find a straight section for each piece of the name. If that doesn't help, "massage" the straightness criteria for that road until a solution is found.
@openstreetmap-trac
Copy link
Author

Author: Ldp
[Added to the original trac issue at 11.48pm, Thursday, 3rd June 2010]

The stylesheet usually repeats names on long roads, but your other points are mostly true. It's a mix of past stylesheet decisions and mapnik behaviour. Some of your points should be addressed within mapnik (the rendered) and some may be addressed by the stylesheet. And some others are much harder to solve cleanly.

Merging roads at render time carries a processing penalty, and due to the way the map is tiled, may introduced other subtle render issues at metatile boundaries. We'll only know about those when we trigger them.

At render time, no road knows anything else about roads closeby, let alone about junctions. Label placement does not take this into account, and is only working in a 'collision avoidance' mode.

Mapnik has a minimum_angle option for texts, but in some cases, that could drop a currently rendering label altogether (short road, sharp angle).

@openstreetmap-trac
Copy link
Author

Author: stanton
[Added to the original trac issue at 10.09pm, Wednesday, 30th June 2010]

Well, the most painful issue of the ones I mentioned is clearly the one about street names not rendering if the way is made up of multiple segments. I'd suggest looking into the regressions (processing penalty and potential rendering issues) and see which of the two issues is the more painful one.

@openstreetmap-trac
Copy link
Author

Author: math1985
[Added to the original trac issue at 11.39pm, Monday, 21st April 2014]

This issue is now being discussed on Github: gravitystorm/openstreetmap-carto#497
I will therefore close the issue here.

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

No branches or pull requests

1 participant