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

Name rendering of unusually shaped forest #2428

Closed
Penegal opened this issue Nov 8, 2016 · 7 comments
Closed

Name rendering of unusually shaped forest #2428

Penegal opened this issue Nov 8, 2016 · 7 comments
Labels

Comments

@Penegal
Copy link
Contributor

Penegal commented Nov 8, 2016

Hello, there.

I found what seems to be a name rendering problem: https://www.openstreetmap.org/way/448092558

As you can see, this forest has a very unusual shape, and that seems to cause a problem in the rendering of it's name: it's not centered on it, even roughly, but on the far left of the polygon. Even if it can't be displayed on the geometrical center of the polygon, it should be a lot closer of it than it is currently.

I suspect this to be a Mapnik issue, but, as I don't know how deep the rendering can be affected by the stylesheet, I prefer reporting it here to be sure, and will report it to Mapnik if relevant.

Regards.

@HolgerJeromin
Copy link
Contributor

The current algorithm is: find centroid, if this is not inside the polygon go to one side and find a suitable place there. North/south position is not changed.
#1740

@Penegal
Copy link
Contributor Author

Penegal commented Nov 14, 2016

That could be improved this way:

  1. find the centroid;
  2. if it is inside the polygon, write label here; if outside, try slightly more on the left, then slightly more on the right, and keep trying while pushing away.

This way, the label would be the closest possible of the centroid, at the cost of complexifying the algorithm; that would improve rendering in such corner cases, though, and the 2., AFAIK, won't be executed on the vast majority of polygons, only on corner cases.

@pnorman
Copy link
Collaborator

pnorman commented Nov 15, 2016

We have very little control over where Mapnik labels polygons, so can't really do anything in the stylesheet.

@pnorman pnorman closed this as completed Nov 15, 2016
@HolgerJeromin
Copy link
Contributor

The correct place would be https://github.com/mapnik/mapnik/issues/

@polarbearing
Copy link
Contributor

I have a parking P icon rendered outside the polygon, so it appears the parking would be in the building, where it is not.

Is that also a mapnik issue, or worth a new ticket here?

52778

@pnorman
Copy link
Collaborator

pnorman commented Nov 19, 2016

I have a parking P icon rendered outside the polygon,

Outside the polygon is an issue here.

@matthijsmelissen
Copy link
Collaborator

Hmm, it sees the relevant code on our side does contain ' marker-placement: interior;'. Is somebody able to create a mimimal example (minimal db and minimal cartocss/xml) to definitely prove it's not a problem on our side?

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

No branches or pull requests

7 participants