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

Improve rendering of street names #497

Open
1 of 4 tasks
matthijsmelissen opened this issue Apr 21, 2014 · 28 comments
Open
1 of 4 tasks

Improve rendering of street names #497

matthijsmelissen opened this issue Apr 21, 2014 · 28 comments

Comments

@matthijsmelissen
Copy link
Collaborator

matthijsmelissen commented Apr 21, 2014

The following issue has been moved over from trac. It needs more discussion as it is not clear how this should be implemented.

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:
    1. at each end and
    2. 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.
@vholten
Copy link
Contributor

vholten commented Apr 22, 2014

Road names are currently repeated on long ways. Example: "East Colfax Avenue", http://www.openstreetmap.org/#map=15/39.7555/-104.4935.

I think this is controlled by the CartoCSS parameter text-spacing.

@matkoniecz
Copy link
Contributor

"Use short_name for features with undisplayable name field" ( #430 ) and "move street label to fit other labels" ( #322 ) are related.

"names of very long roads appearing just once" is already done, see https://www.openstreetmap.org/way/259974845#map=17/49.52298/20.24377 for an another example. Though it can be tweaked to repeat more frequently.

@Zverik
Copy link
Contributor

Zverik commented May 7, 2014

For rendering labels, komap uses (abridged sql) select name, ST_Simplify(ST_LineMerge(ST_Union(way)), %f) as way from (SELECT * from planet_osm_line where way && ST_Expand(!bbox!, %f)) as tex group by name (where %d is zoom-dependent, but ST_Simplify can be omitted). I use a similar sql in my CartoCSS style (to be published next week). It joins all ways with equal names in a tile.

It obviously slows down rendering, but the resulting style looks much better, sometimes even better than commercial online maps. You can compare the result with regular OSM styles here.

@pnorman
Copy link
Collaborator

pnorman commented Jul 20, 2014

%d

@Zverik, do you mean %f?

@pnorman
Copy link
Collaborator

pnorman commented Jul 20, 2014

My immediate concern with this is that it will lead to increased label placement differences between metatiles because each metatile now has completely different linestrings. Thoughts?

I know one way of resolving this is to actually have labels done in the DB or in SQL, and just label points, but I've not explored that.

@geostonemarten
Copy link

can you add a solution to remove duplicated highway name for sidewalk
I have send a question about #3318 (comment) in a merged subject...

Originally posted by @SomeoneElseOSM in #3318 (comment)

@SomeoneElseOSM have send response for that situation

https://github.com/SomeoneElseOSM/SomeoneElse-style/blob/master/style.lua#L974 .

@kocio-pl
Copy link
Collaborator

kocio-pl commented Nov 20, 2018

It should be doable also without lua transformations.

Currently 28 907 out of 1 002 840 sidewalks have a name:

https://taginfo.openstreetmap.org/tags/footway=sidewalk#combinations

@geostonemarten
Copy link

geostonemarten commented Nov 20, 2018

@kocio-pl in fact that can be uprising because this is on discussion with French other contributors delete the names because it considers that have bad rendering for the display.

@kocio-pl
Copy link
Collaborator

Is it also a problem for areas or only for lines? We have a roads-area-text-name and paths-text-name data layers in project.mml for rendering names, both include footways and could filter out these with footway=sidewalk.

@pnorman
Copy link
Collaborator

pnorman commented Nov 21, 2018

We wouldn't use Lua for this, we'd just delete the CartoCSS rules for names on footway/path/cycleway.

I'd want to see more evidence about the pros and cons of this before deciding if it was a good idea.

@geostonemarten
Copy link

Is it also a problem for areas or only for lines? We have a roads-area-text-name and paths-text-name data layers in project.mml for rendering names, both include footways and could filter out these with footway=sidewalk.

I haven't check that but i can test it.

We wouldn't use Lua for this, we'd just delete the CartoCSS rules for names on footway/path/cycleway.

I'd want to see more evidence about the pros and cons of this before deciding if it was a good idea.

Ok, for me If you have a sidewalk path you have also a major road. Is it possible to check that case with overpass. Ideally It would be a good idea to use also a distance according to the zoom.

This is in relation toSidewalk as separate way

Other problematic is in relation to parallel cycleway lanes with names. I Think it's more easy for rooting if name exist on path. Anyway for the foot path (specific to blind or wheelchair) it is good practice to represent a reality with specific markings. An solution exist based on this to create specific rooting (specificly for blind with accelerated text to speech)

for exemple Versailles France zoom 17 surligned footway
image
In yellow footway, in red living_street, in blue cycleway, in black highway tertiary
image

https://www.openstreetmap.org/search?query=paris#map=17/48.80268/2.13187

I think this problem is only on zoom >= 17

@kocio-pl
Copy link
Collaborator

Here's what I've found in my city which I thought initially is a con, but now I think this is bad tagging - this footway is not a sidewalk (it's not on a side of the road):

https://www.openstreetmap.org/way/20931443

screenshot_2018-11-21 openstreetmap

@SomeoneElseOSM
Copy link
Contributor

but now I think this is bad tagging

Yes, that's doesn't look like a sidewalk - there's nothing mapped for it to be the sidewalk of.

@kocio-pl
Copy link
Collaborator

kocio-pl commented Nov 21, 2018

If we follow the logic of sidewalk being accompanying (parallel) way, which is how it's meant in general ("a path along the side of a road" in Wikipedia) and in OSM definition ("part of a highway set aside for the use of pedestrians and sometimes also cyclists, separated from the carriageway (or roadway)"), I think it would be hard to find any cons, because the name of a main road is always expected if it exists.

It might happen that these names are different or a main road does not have a name, but I guess this is an exception from general rule and the clutter is already visible currently.

@jragusa
Copy link
Contributor

jragusa commented Nov 21, 2018

I agree to remove label of path/footway when associated to footway=sidewalk

@kocio-pl
Copy link
Collaborator

@pnorman Do you think it would be better to remove labels in SQL (project.mml) or in the styling part (roads.mss), if we decide to?

@geostonemarten
Copy link

Here's what I've found in my city which I thought initially is a con, but now I think this is bad tagging - this footway is not a sidewalk (it's not on a side of the road):

https://www.openstreetmap.org/way/20931443

screenshot_2018-11-21 openstreetmap

That is a tagging problem because this is not a sidewalk.

@pnorman
Copy link
Collaborator

pnorman commented Nov 23, 2018

Ok, for me If you have a sidewalk path you have also a major road. Is it possible to check that case with overpass. Ideally It would be a good idea to use also a distance according to the zoom.

This would all need to be done in CartoCSS. The only stuff that comes to mind is the buffering for identical labels, nothing elsse seems like it would relevant to what you're proposing.

This is in relation toSidewalk as separate way

We can't do anything with those relations.

@1ec5
Copy link

1ec5 commented Nov 23, 2018

This is in relation toSidewalk as separate way

We can't do anything with those relations.

Pretty sure that was “in relation to” as a preposition, not a reference to any kind of relation. 😉

@jeisenbe
Copy link
Collaborator

jeisenbe commented Nov 23, 2018 via email

@kocio-pl
Copy link
Collaborator

I believe that would be smaller problem than a current one. Also, I'd like to check the examples to see how many of them are there and if it is that bad.

Another solution might be to make bigger spaces between labels on sidewalks, similar to latest road labels tuning - see for example #3318 (comment).

@geostonemarten
Copy link

Not only big space because you need set a priority to displayed names by type of label. In addition not all footway was sidewalks. Other problems with bigger spaces is deletion of to many names

@kocio-pl
Copy link
Collaborator

I don't quite understand - do you think it's better to remove all the sidewalk labels than just make bigger spaces between labels?

@geostonemarten
Copy link

Exactly. For bigger spaces, I am ok for all highway without sidewalk information.

@kocio-pl
Copy link
Collaborator

But we were discussing lines and areas, so I'm still confused. Could you make it more detailed?

@geostonemarten
Copy link

reread my message please. #497 (comment)

line and area is an other problem and is discuss in an other issue

My discuss is on twice subject:

  1. ignore labelling on footway with sidewalk footway=sidewalk and footway=crossing (because problem is same)
  2. add buffer detection on others ways with priority classification for labelling

In first subject we don't need labelling if this is same name as major side road because this is just a micromapping schema and this solution is better for me for many reasons. sidewalk path can uniquely exist if you have a major road in other case this is mapping error and not a display problem.

In second subject: if cycleway have same name of side highway=residential we don't need labelling cycleway.
for me priority is : motorway*>trunck*>primary*>secondary*>tertiary*>residential>=unclassified>bus_guideway>living_street>=pedestrian>road>steps>truck>path>cycleway>footway> ... others

stars for "_link"

I can't test my proposition because I haven't install server and database for that.

@Adamant36
Copy link
Contributor

Adamant36 commented Nov 27, 2018

ignore labelling on footway with sidewalk footway=sidewalk and footway=crossing (because problem is same)

@geostonemarten, am I wrong to assume that's a miss-tagging issue when its done and the have the same name as the road, since it violates the naming conventions?

@geostonemarten
Copy link

geostonemarten commented Nov 27, 2018

@Adamant36 which convention? name can be identical on sidewalk as a separeted way. This is just an other way to create road and specific part with description. problem is on lisibility on map rendering. If you want create a map with show case on cycleway and sidewalk you reverse priority on map and the rendering.

You need separate data and rendering in fact this is done partially with @kocio-pl bigger space. But in this map you don't need name on sidewalk because there is a major road name and (micromapping) sidewalk overload readabillity

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

No branches or pull requests