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

Tie POI names to icons #234

Open
pnorman opened this issue Oct 17, 2013 · 20 comments
Open

Tie POI names to icons #234

pnorman opened this issue Oct 17, 2013 · 20 comments

Comments

@pnorman
Copy link
Collaborator

pnorman commented Oct 17, 2013

If a POI icon conflicts with another label but not its text right now the text will be rendered without any icon. Examples have shown up in #232 and maybe #201 but I've seen it locally.

A simple example is
18/41567/89792
The restaurant text conflicts with the icon. Also, the text is not centered on the POI because it's offset to below to allow for an icon.

A more complex example is
18/41565/89790

AFG Kabul Bakery (shop=bakery) has its label rendered, but the icon conflicts with the icon for Zahra's Ultimate Hair Design (shop = hairdresser). With the name it's fairly obvious what AFG Kabul Bakery is, but there's no icon to it.

Oddly, it looks like the text for Zahra's Ultimate Hair Design conflicts with the AFG Kabul Bakery text.

It would be an improvement if the POI name was only rendered in conjunction with the icon, and if there wasn't room for the icon it didn't render either.

This will probably not impact rendered POI density significantly because in dense areas where this is an issue the blank space from removing the name will probably be taken up by another icon.

@gravitystorm
Copy link
Owner

The traditional solution for this is to (ab)use shieldsymbolizers, to guarantee both text and image at the same time. Since my preferred hierarchy of preference is:

  • icon + label
  • icon
  • nothing
    ... that would imply using a shieldsymbolizer followed by a pointsymbolizer, in order to fill in more spaces with bare icons on a second attempt. At that point though, I wonder whether it's better to introduce a new feature in mapnik to have a grouped-symbolizer with controllable characteristics.

@pnorman
Copy link
Collaborator Author

pnorman commented Oct 17, 2013

I honestly cannot recall this many detached names in the old style. Do you know if there were? I guess we now have z19, so the number of zoom levels that render shops has increased from 2 to 3.

@matkoniecz
Copy link
Contributor

Maybe more shops are tagged so places with high density of POIs are more common?

@matkoniecz
Copy link
Contributor

It would be an improvement if the POI name was only rendered in conjunction with the icon, and if there wasn't room for the icon it didn't render either.

IMHO it is better to render only icon or only text rather than nothing.

@matthijsmelissen
Copy link
Collaborator

Does anyone have any suggestions on how to accomplish this?

@pnorman
Copy link
Collaborator Author

pnorman commented Dec 12, 2014

I think andy's solution is workable

@matthijsmelissen
Copy link
Collaborator

Wouldn't that cause the label from POI 1 to prevent the icon from POI 2 from rendering? I think icons should always have a higher priority than labels.

@daganzdaanda
Copy link

I honestly cannot recall this many detached names in the old style.

Yes, I get the feeling that this has increased recently in my home area. And I don't think that there were many shops added. Right now, doctors begin to show up in the tiles, which is great. But this adds many more icons.

Maybe the distance between icon and label (text-dy?) has been increased too much? Especially the generic shop dot is too far away with most Roman labels. Since we can't use a dynamic distance that follows the actual letters (or can we?), hopefully #957 will be possible somehow. It may reduce these "orphan" icons significantly.

@nebulon42 nebulon42 self-assigned this Mar 24, 2017
nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue Mar 25, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
@boothym
Copy link
Contributor

boothym commented Mar 29, 2017

Noticed this happening to bus stops and memorials with names missing, example here: https://www.openstreetmap.org/node/502530719#map=17/55.95858/-3.20779

@nebulon42 hoping your PR will solve it :)

@nebulon42
Copy link
Contributor

Unfortunately, that's unlikely. My PR would solve labels without icons. At the link it looks like the bus stop label is blocked by the address.

@boothym
Copy link
Contributor

boothym commented Mar 29, 2017

My PR would solve labels without icons. At the link it looks like the bus stop label is blocked by the address.

Am I mistaken or isn't that exactly what my link is, a bus stop label without an icon? 😕

What about this memorial without an icon then? https://www.openstreetmap.org/node/4725017784#map=17/56.05863/-3.23502

@nebulon42
Copy link
Contributor

Am I mistaken or isn't that exactly what my link is, a bus stop label without an icon?

Hm, ok, I'm only seeing a bus icon without label on z18 but never mind. The memorial I see too. Yes, that should be solved by #2597.

nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue May 1, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue May 1, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue May 7, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue May 7, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue May 20, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue May 20, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
nebulon42 added a commit to nebulon42/openstreetmap-carto that referenced this issue May 25, 2017
…s, a second pass of only icons fills up free space, dy was harmonized, restructuring of code to avoid repetition, fixes gravitystorm#234
@matthijsmelissen
Copy link
Collaborator

We currently have no good way to accomplish this, so I am going to close this issue.

At that point though, I wonder whether it's better to introduce a new feature in mapnik to have a grouped-symbolizer with controllable characteristics.

I agree. @springmeyer what do you think of this? I can imagine others struggle with the same problem so I think this would be nice to have in Mapnik.

@dieterdreist
Copy link

dieterdreist commented May 7, 2018 via email

@matthijsmelissen
Copy link
Collaborator

No, that is not what we need: shield symbolizers prevent rendering text without icon, however they also prevent rendering icons without text. We don't want the latter.

@nebulon42
Copy link
Contributor

I did already show that it is possible to have both in #2597. However, there is also a GroupSymbolizer in Mapnik 3, but someone would have to implement it for CartoCSS.

@dieterdreist
Copy link

dieterdreist commented May 10, 2018 via email

@pnorman
Copy link
Collaborator Author

pnorman commented May 27, 2018

you could first try the shields and after that try just markers to fill up the gaps. Admittedly there is a performance penalty involved.

Is this penalty significant?

@jeisenbe
Copy link
Collaborator

jeisenbe commented Sep 7, 2019

#2597 was interesting. I've noticed this problem is particularly acute with aerodromes (airports) at low zoom levels in my area. The airport is often right next to the town, so the icon may be blocked by the name of the town, but the purple text label renders right below the town name.

@kocio-pl
Copy link
Collaborator

kocio-pl commented Sep 8, 2019

From #234 (comment):

However, there is also a GroupSymbolizer in Mapnik 3, but someone would have to implement it for CartoCSS.

I understand that would make icons with optional labels possible? Is there anybody willing to do that?

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

Successfully merging a pull request may close this issue.

10 participants