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

remove "text-min-distance" in placenames.mss #2189

Closed
matkoniecz opened this issue Jun 21, 2016 · 8 comments · Fixed by #2195
Closed

remove "text-min-distance" in placenames.mss #2189

matkoniecz opened this issue Jun 21, 2016 · 8 comments · Fixed by #2195
Assignees
Labels

Comments

@matkoniecz
Copy link
Contributor

as documented on https://github.com/mapbox/carto/blob/master/docs/latest.md it sets

Minimum distance to the next label with the same text. Only works for line placement.

@matkoniecz matkoniecz self-assigned this Jun 21, 2016
@matkoniecz matkoniecz added this to the Bugs and improvements milestone Jun 21, 2016
@matkoniecz matkoniecz changed the title spurious "text-min-distance" in placenames.mss "text-min-distance" in placenames.mss Jun 23, 2016
@matkoniecz
Copy link
Contributor Author

matkoniecz commented Jun 23, 2016

It is interesting. It turned out that removing text-min-distance significantly increases number of displayed labels.

It seems to be a positive change, I will submit this change anyway - but for a different reasons. It improves rendering at low zooms (12+ needs testing) and it makes style closer to working the same in mapnik 2.3 and mapnik 3.0.

Initial confusion was caused by redefining text-min-distance in mapnik 2.3 means

Minimum permitted distance to the next text symbolizer.

and was changed to

Minimum distance to the next label with the same text. Only works for line placement. Deprecated: replaced by text-repeat-distance and text-margin

In mapnik 3.0.

https://github.com/mapbox/carto/blob/master/docs/2.3.0.md#text-min-distance-float
https://github.com/mapbox/carto/blob/master/docs/3.0.0.md#text-min-distance-float

current state
https://cloud.githubusercontent.com/assets/899988/16315567/14e33c72-3983-11e6-8445-0f48209eeb8c.png

without text-min-distance
https://cloud.githubusercontent.com/assets/899988/16315568/14e613c0-3983-11e6-98b3-d9d599ac1d91.png

(BTW, something went wrong with rendered borders - but it seems to be bug of my local environment/database given that it appears in before that is the current release...)

https://cloud.githubusercontent.com/assets/899988/16315599/3132cd70-3983-11e6-80b6-122259c28b9d.png
https://cloud.githubusercontent.com/assets/899988/16315619/454897fe-3983-11e6-9814-f1572ba6ef51.png
https://cloud.githubusercontent.com/assets/899988/16315621/4555732a-3983-11e6-8c6b-978d522a4ffe.png
https://cloud.githubusercontent.com/assets/899988/16315620/4552fb7c-3983-11e6-9f00-e3819b406c66.png
https://cloud.githubusercontent.com/assets/899988/16315633/51d12eaa-3983-11e6-90d1-55d8a1b04deb.png
https://cloud.githubusercontent.com/assets/899988/16315634/51d3ba12-3983-11e6-9776-089425f940e5.png
https://cloud.githubusercontent.com/assets/899988/16315639/52086230-3983-11e6-805a-8bf2e010db98.png
https://cloud.githubusercontent.com/assets/899988/16315640/520b7056-3983-11e6-86cb-5f84e47e2129.png
https://cloud.githubusercontent.com/assets/899988/16315637/52051f80-3983-11e6-8d98-936a151a0139.png
https://cloud.githubusercontent.com/assets/899988/16315638/52060ecc-3983-11e6-8459-8ee0ec898efb.png
https://cloud.githubusercontent.com/assets/899988/16315635/51f5e664-3983-11e6-894d-575510f7a67c.png
https://cloud.githubusercontent.com/assets/899988/16315636/51f9d698-3983-11e6-9e8e-3919720eb6b5.png

EDIT: carto -> mapnik, thanks to @nebulon42 for explaining why I was mistaken.

@matkoniecz matkoniecz changed the title "text-min-distance" in placenames.mss remove "text-min-distance" in placenames.mss Jun 23, 2016
@nebulon42
Copy link
Contributor

@matkoniecz when you write carto you probably mean Mapnik?!

@matkoniecz
Copy link
Contributor Author

matkoniecz commented Jun 23, 2016

@nebulon42

Hopefully I am not mistaken:

As I understand every Carto version matches Mapnik version (with the same version number).

I guess that in this case changes in Carto are caused by and reflect changes in Mapnik.

But given that I was checking documentation for carto (https://github.com/mapbox/carto) without checking whatever matching changes happened in Mapnik I was writing about Carto changes.

@nebulon42
Copy link
Contributor

The most recent carto version is 0.16.3, which I published just minutes ago. But there is https://github.com/mapnik/mapnik-reference, which matches Mapnik version numbers and is used by carto to get the parsing right. This is also referenced in the documentation. So you are talking about API versions of Mapnik/carto but not necessarily about carto release versions. I agree that this can be a bit confusing.

@matkoniecz
Copy link
Contributor Author

Thanks for explaining! So I was confused.

So https://github.com/mapbox/carto/tree/master/docs is not about capabilitoes of different carto versions, but what can be done with latest carto version with given mapnik version?

So for example https://github.com/mapbox/carto/blob/master/docs/2.0.0.md is what latest carto can do with mapnik 2.0.0 and https://github.com/mapbox/carto/blob/master/docs/latest.md is documentation of what can be done with latest carto in latest mapnik.

@nebulon42
Copy link
Contributor

Yes, that is correct. Currently latest.md is identical with 3.0.9.md.

@matkoniecz
Copy link
Contributor Author

To add to my confusion I see no related changes in https://github.com/mapnik/mapnik/wiki/Api-changes-between-v2.3-and-v3.0 and it is not mentioned on https://web.archive.org/web/20160527235459/http://mapnik.org/news/3.0-cartographer

So the same carto version interprets the same definition differently, depending on Mapnik version despite that Mapnik API is the same? Or is this API changes page incompleted?

Or is it caused by change in https://github.com/mapnik/mapnik-reference, unrelated to change in Mapnik?

@nebulon42
Copy link
Contributor

So the same carto version interprets the same definition differently, depending on Mapnik version despite that Mapnik API is the same? Or is this API changes page incompleted?

carto does not interpret much. It uses mapnik-reference to get to know about which attributes are valid and which aren't. You would have to compare the generated Mapnik XML to be sure, but I'm quite confident that the change in rendering can be attributed to internal Mapnik changes. So I guess the API page is incomplete. Maybe mapnik/mapnik#2362 is a starting point to find out more (I did only superficially check if it is related).

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

Successfully merging a pull request may close this issue.

2 participants