-
Notifications
You must be signed in to change notification settings - Fork 821
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
Low zoom waterbody rendering and move to water polygons #2507
Comments
Regarding reservations against using preprocessed data I personally think that's ok if the data comes from OSM itself and can be periodically updated. Both is the case for the data at openstreetmapdata.com. |
I'd keep them split. We already have #1982 for switching to ocean polygons, but we've never tracked down the bugs reported in #2101. If we had those solved we could revert the switch from ocean to land polygons. For the reduced waterbodies, I'm not sure they're suitable for two reasons
|
I explained the connection - if we use the full detail water polygons for z7+ we don't have to use the simplified water polygons which IIRC is what caused troubles for some users. If we have already moved to water polygons when we implement this it is no problem either. What we cannot really do is use this approach together with land polygons but i don't think anyone would want that.
Details are explained on http://www.imagico.de/map/polygon_rendering.php Tools used for that are all available: https://github.com/imagico/osmium_waterareas The rest is just shell scripts putting this together. I might write a practical howto about this in the future but this does not have high priority at the moment. In a nutshell:
You need to have and use the data source for your target resolution. For double resolution tiles this is just one zoom level offset. The lack of possibilities to do this automatically for any data sources other than PostGIS makes this somewhat awkward of course. If you use the polygon version and import this in PostGIS (which is not really an option for us here) you can select this automatically based on the |
I had another read and the only tool mentioned from that list is gray2vec. I'll have a look at what you've described in this ticket to see if that provides enough information for someone else to go from a planet file to the same output.
It needs to be automatic, i.e. we don't know what resolutions will be generated when generating the Mapnik XML, so the same XML has to work for normal tiles, retina tiles, print, and arbitrary Mapnik scale factors. |
Then i predict we won't get low zoom waterbodies because it does not seem likely Mapnik will be extended in that regard. Note though that even using the z6 version for all z0 to z6 would - while it is not the intended use - probably still look better than any other workaround that has been suggested for this problem in the past. |
With all waterbodies rendered now on low zoom (as a result of merging #2873), is there still a reason to switch to water polygons? |
Yes - it's needed for some interactions between wetlands and water, as well as generally being preferred. In fact, the reasons remain exactly the same. This was never about great lakes and other non-ocean waterbodies. |
Maybe it was not supposed to be initially, but - as far as I understand - it's proposed by @imagico as a superior solution for low zoom inland water rendering, currently in the context of #2952: http://www.openstreetmap.org/user/imagico/diary/42975#comment40536 but, honestly, it's hard for me to believe it's happening:
Was there any try to contact Mapnik team, like ticket for example? What could we do instead?
It was proposed year ago - what do you plan to implement it and what do you need from the others to make it real? |
@imagico, would this work for different resolutions, eg exporting at 4x from Kosmtik, or producing PDFs for printing? My understanding is that the preprocessed data will look better and render faster than the current rendering. Perhaps it won't look perfect when rendered at higher resolutions than intended, but won't it still be an improvement on the current map? |
No - at least not any better than using a raster image would. Note however that rendering maps for print at z0 to z6 is not really a practically relevant use case. Still of course that it is not possible to dynamically select a data source based on rendering resolution with layer types other than PostGIS is a serious problem. Note technically the reduced waterbody data is kind of superseded by the technique used for the low zoom demo: http://blog.imagico.de/on-basic-small-scale-landcover-rendering/ - this offers both better efficiency (and therefore additional zoom levels) and allows use for both waterbodies and landcover rendering. Unfortunately this is only in a demo state and so far no one showed interest in investing in extending that to a practically usable framework. The difficult integration into normal map rendering does not help with that of course. Back in 2016 when this issue was opened the direction for low zoom styling was fairly clear and this issue was to discuss a practical option for this. In the meantime practical changes have moved the low zoom styling into a completely different direction - but there is not really a clear path visible where this is supposed to go (at least not to me). Right now it more or less looks to me like we have to fill the tiles at these zoom levels somehow but don't really care. So i am not really sure if pursuing the technical ideas discussed here is still of relevance. It would be great if someone would step up and really take interest in low zoom level design here again - but as you can see the technical difficulties are anything but trivial. Apart from the waterbodies and landcover the boundaries are a big issue as well. |
I probably should have clarified that I'm mainly trying to find a solution that will allow us to switch to ocean polygons, since that is a necessary prerequisite for a number of issues.
True! The current rendering looks quite poor when exported at these levels
Yes, I've noticed that the very low zoom border from Natural Earth do not match well with our coastlines, and they are rather jagged for z3, and for exports at higher resolutions from z1 and z2. I would be great to have generalized or simplified admin_level 2 and 4 borders for low zoom.
But this data is not available, is it? I'd like a solution that we can use to switch to ocean polygons, soon. It looks like all the the maintainers agree that ocean polygons are the right solution. I've considered trying the generalized water polygons for z0 to z8, This gets us down to a zoom level where it is reasonable to use It helps that I love the way the generalized coastlines look! I've tried exporting the coastlines at 2x and 4x resolution, and it works fine. Indonesia at z4 Without blue line for coastline Maluku (Spice Islands) z9 Current rendering (with Can we consider the use of the generalized coastlines at low zoom levels? The current rendering with the smoothing and outline has a similar effect, but it takes much longer to render and does not work as well. |
The simplified ocean polygons sample does not seem right - the ocean polygons are split, i see no way you can create the rendering shown based on these. Regarding use of the reduced files at zoom levels below the intended ones - while that works in principle you very soon get errors larger than the ones you'd get when rendering the original data in mapnik - and this effect will get stronger with increasing zoom level. And as said you have no way to automatically select the shapefile that is best to use. |
Are you referring to the z8 rendering of Wales from this comment a few days ago? I may have uploaded the wrong file. I've rendered it again and replaced it. Wales z8 with
In these tests I used 5 shapefiles (z2, z3, z4, z5, and z6) to render the 5 zoom levels from z0 to z4. I wouldn't want to use them at more than 2 zoom levels below where they were intended. The side-by-side comparisons show that most pixels are very similar even when off by 1 or 2 zoom levels. This is much better than what we see when rendering landcover at z5 and z6 from full data in Mapnik, where areas made up of many small polygons disappear entirely. And the large lakes are the same.
This is a shame, it's true. Would you have time to open an issue on the Mapnik repository to discuss this? I'm not sure how to describe the technical requirements. If this were fixed we could use the raster files for water (and landcover, a la French style), and this would be both fast and small file size. But the reasonable use case for this style at z0 to z5 is for standard resolution and retina tiles. Being able to render two resolutions, standard and 2x, is enough, and the reduced polygons work well for this. |
Yes, that would be possible - would of course require someone to actually implement it. Note though this would only be of advantage if you render on these particular grids - for print use you usually can't rely on a specific grid alignment. What i have not tried so far is how it looks like of you re-sample the raster version to a coarser grid. Mapnik does not support |
This issue is meant for planning and discussing implementation of low zoom waterbody rendering based on the recently introduced preprocessed data and combined with that the move to water polygons for the coastline.
I assume there might be reservations regarding the technical approach used but please consider this in terms of alternatives - there are not too many other ways to get waterbodies rendered at low zoom levels.
The preprocessed data is produced for z0-z6. There are two possibilities for the coastline beyond that:
Apart from that if we go with this approach a decision would be necessary whether to use the raster or the polygon version. A demo implementation using the raster version is available on
https://github.com/imagico/openstreetmap-carto/tree/water-lowzoom-raster
This also implements the three color scheme for water but this is not meant to suggest these changes need to be connected - it just made sense for testing.
Overall this would solve/replace #1604, #1982, #2066, #2101, #2293
and would facilitate a solution for #1547 and #1781.
The text was updated successfully, but these errors were encountered: