-
Notifications
You must be signed in to change notification settings - Fork 819
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
Possible Mapnik enhancements #2962
Comments
Not just OSMF - I've struggled to get Mapnik to build reliably even in "off the shelf" distributions. Trying to keep up with OSM Carto's "node" requirements was something of a pain for e.g. https://switch2osm.org/manually-building-a-tile-server-16-04-2-lts/ ; now that the dust has settled there it'd be a shame to see something else crop up that caused similar issues :) |
Unfortunately there will always be some problems, because OSM (beside the main database) is highly distributed, so for example:
but there are also other important branches of this inter-dependency chain:
With Mapnik 3.0.16 released we have experimental Debian package, so I was able to take the shortcuts and compile Mapnik nodejs (but I also had a problem with too fresh nodejs package!), then test it in Kosmtik using hacked symlink. That was not too hard, because there were just bugfixes and it has no implication for our code, but still it took me some time and required asking Kosmtik and Mapnik developers. Moreover I was able to build from Debian package code on Ubuntu with no changes. However new features in 3.1 will require more planning and effective communication between projects if we stick to the idea of using released and packaged code and care for updating standard layer on OSM.org. |
BTW: where can I propose and discuss some improvements in the switch2osm.org documentation? Once I have tried IRC channel, but had no luck to catch someone related to this project. |
If you mentioned it on IRC I probably wrote it down and might incorporate it at some stage, but it'd be in a list with quite a lot of other potential changes. If it's a new page you're looking for then mention it to @systemed ; if it's sensible I suspect he'd just add it. |
I was afraid that it will get lost in the chat, some ticket system or even simple list on Wiki would be nice... |
There's a github site that @pnorman created, but that seems to be half-way between the switch2osm site as it stands now and something else (and relatively few "current" pages are there). Actually, seems like you found it already: https://github.com/switch2osm/switch2osm.github.io/issues . |
On the CartoCSS side the only bottleneck are developer resources for CartoCSS and therefore the CartoCSS update part. |
Thanks, it's good to know what's the state of our important upstream project! I believe |
I just had a quick look, but would say that nothing would have to be implemented. With current master or with 1.0 you could just plug in that custom reference from @talaj and you would be done (if I'm not missing something). Of course your version of Mapnik would have to support that too and you would not being able to test that with Kosmtik unless the custom Mapnik would be available as npm package and it would be possible to wire that alternate version to Kosmtik. @kocio-pl I have not found polylabel, where is it in the reference? |
Polylabel is a drop-in alternative algorithm for interior and is currently developed as part of the upstream Mapnik: mapnik/mapnik#3550 (comment) However grid can have some options we would surely need ("if you set repeat-distance to a large value, the grid placement will put single label on closest place near interior" - mapnik/mapnik#3780 (comment)) and some other too ("Grid density can be controlled by grid-cell-width and grid-cell-height properties of the symbolizer" - https://github.com/talaj/mapnik/blob/master/docs/features/placement-grid.md). Wouldn't it need some coding on the part of CartoCSS? I don't think Carto is the problem now (especially with 1.0 expected in the coming months!), but long time between Mapnik releases can be: v3.0.0 is from 7.07.2015 and 3.1.0 is just 40% complete... It is not fully semver compatible (mapnik/mapnik#3372 (comment)), so maybe new placement types can be added as "minor new features" within v3.0.x line, but we can't be sure. That's why I ask if there are some other Mapnik CZ features we would like to use, so we could monitor their availability and help to resolve the problems along the way. |
There was a discussion about tying labels with icons (I just can't find this ticket now), and I guess this is the feature that would be needed for this: https://github.com/talaj/mapnik/blob/master/docs/features/anchors.md |
No, I don't think it would. |
Requiring a fork would significantly make it harder for new contributors, particularly those relying on node-mapnik. I'd love to have more features and different release management, but I don't see it's worth the current costs. This could change if it became easier to use the fork, or the gains from it increased. |
That was not my intention to switch to the fork and I haven't even thought about that option. I'm asking if we would like to have some particularly interesting features, so we could ask to port them upstream. The |
I don't understand this, how would country/state labels be rendered in a grid? |
It was also not clear for me until I read the actual documentation... 😄 This is a general method for
(see mapnik/mapnik#3780 (comment) ) |
I guess nobody found anything else which would be interesting for us, so I close this issue now. |
Would the ability to specify font-wrap in em something that fits this topic? That would save us a lot of code. |
Sure, everything that we'd like to have in the rendering engine. I wanted to make osm-carto team aware that it's sometimes better to cooperate with Mapnik directly and find general solutions instead of trying local workarounds. So far it was a nice surprise for me that Mapnik developers are responsive. Did you found this feature in @talaj fork (I can't recognize it in https://github.com/talaj/mapnik#mapycz-mapnik), or it's just something that would be nice to have? |
Just something nice to have. |
Just something nice to have. And I think it makes sense for many maps: many maps have increasing label size when zooming in. In that case, it makes sense to keep the word wrap at the same place in the word, and the way to accomplish that is to specify wrap-width in em (or, as we do, specify a different wrap-width for every label size calculated in such a way to keep the em constant). |
...speaking of which: mapnik/mapnik#3847 😄 |
And a link to your ticket about em: mapnik/mapnik#3763 |
Totally forgot I had already reported it :) |
line-dash-capping? so we can implement intermitent thick casings like the ones I tried to implement for unpaved roads. |
I guess this is another feature that is not available yet even in the Czech fork. Did you open the ticket in Mapnik? If you do, please drop a link here, so we could follow the progress and react if needed. |
Mapnik 3.0.19 has been released and Debian packages are available, so soon the Ubuntu package will be released too and OSMF sysadmins can deploy it (finally!...). This version contains new area label placement implementation (fixing external bugs like #1465) and contains |
There are new options of text and shield symbolizer I now realized that there is no default value for these two options. |
Ubuntu 18.04 currently contains Mapnik 3.0.18 (not 3.0.19 - ot sure if that makes a difference to anyone). The current style seems to "just work" on a system installed on that. I haven't checked any new options. |
3.0.18 is affected with Since the Debian package is available, I hope the version will be updated in Ubuntu soon. |
The good news is that using Kosmtik from git openstreetmap-carto/placenames.mss Lines 45 to 64 in cadf491
I have changed the line text-placement: grid;
text-grid-cell-width: 10;
text-grid-cell-height: 10; and this is the result (Poland, z6): Now I try to learn how to control repeat distance, so there's only one occurrence of each label. |
Another application for This would be helpful to remove SVG pattern files and avoid generation chain problems like #3051 (comment). It should be tested however. |
I've learned about Mapnik fork by @talaj, which is used for mapy.cz and has some additional features:
https://github.com/talaj/mapnik#mapycz-mapnik
Is there anything you think might be useful in our style?
I would like to have placement type
grid
merged into the Mapnik (useful for country/states labels). This may take some time, because Mapnik release cycle is long and we need any new features to be covered also by Carto CSS (see thelist
placement for example). There's also additional complication related to the fact that OSMF needs Mapnik packages for Ubuntu. However that gives us some perspective for future development.The text was updated successfully, but these errors were encountered: