-
Notifications
You must be signed in to change notification settings - Fork 827
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
Separately adjusting rendering over water and over land #3854
Comments
I would actually suggest using the water polygons rather than a global backdrop; this also works with different colors for rivers and oceans. And it's required to give us the option of using an outline for oceans, as discussed in #3695 (comment) - I hadn't mentioned this yet, but I had separately come to the conclusion that using
In the rendering, this results in this order, bottom to top:
Then the rest of the layers work as before. |
See how Carto-CSS does compositing operations here: Basically, the default behavior is that each new layer is added over the previous image. Each time a layer is created, a new raster image, with colors and transparence for each pixel, is created, by adding the new layer on top of the previous ones. This default is called
Then, we can use Apparently folks who use photoshop and similar image-editing software are quite familiar with these things. We will probably need to add notes to each affected layers in |
Another advantage of this change: we could render water-lines like rivers, ditches and streams on top of all of the current overlay patterns, e.g. woodland/forest, scrub, bare_rock, so the patterns will not make it harder to see watercourses. We could have a special fill color (blue-green?) for |
Yes, you can implement a water area halo this way as well. I would not recommend completely stripping the landcover-area-symbols layer because it serves an important function to provide feedback to mappers about accurate geometries. Rendering the patterns for scrub/wood/wetland this way makes a lot of sense. I implemented the whole idea in the ac-style: Here a sample of what kind of options this provides visually: Care needs to be taken when rendering certain areas land only or water only of course - the way this is shown for reefs (i.e. water only) would not be good for mapper feedback in this style because it would hide mapping inaccuracies. |
Thanks for the examples. I wonder if this change might make it easier to render borders differently over water and land from the boundary relations only. This would provide a nice solution for #621. It also would allow us to get rid of the use of transparency, by rendering the land borders in a solid color right on top of landcover, and then using a transparent border layer later, to show borders semi-transparently over roads and waterways (if desired). It could be done like this:
|
Also a good guide: |
Re: #3883 - should we move the patterns like If we want to render the tree and scrub patterns over water areas, but not over waterway lines, this would require another layer, like this:
|
@pnorman - usually you are the maintainer most skeptical of increased code complexity. What are your thoughts about the relayering discussed in this issue? It's necessary to render a proper outline around the ocean polygons (See issue #3695 and PR #3065 an dissue #3895) as well as to allow properly rendering areas of beach, shoals, reefs and tidal flats differently over water without resorting to transparency (#3894, #3877, #3883, #3864, #3840 etc) and could also nicely solve the rendering problems with admin borders over water vs land (see #3102), but it would make the rendering order less intuitive. |
We had quickly discussed that in Heidelberg and there was agreement that a working demo code based on the current code demonstrating the idea (in other words: a usable PR) would be good as a basis for deciding on this. This is on my todo list but i have not gotten around it yet. Anyone else is welcome to get ahead of me. |
Adjusting layer order shouldn't impact complexity. comp-op operations might, but I don't have a good intuitive grasp on how much complexity they would add to the MSS. |
The main difference will be that instead of having to learn that layers are rendered in reverse order to their appearance in This would require some more learning for new contributors, but adding the comments might actually make it easier to understand the current rendering for contributors who haven't worked with Mapnik/CartoCSS before.
@imagico - if you can write the basic working code, I could test it and make the images and the PR, if that would save time. |
@imagico any chance of seeing a PR this month? I could give it a try, but I think I have too many open PRs already Initially I hoped to implement #3930 and decide on the ocean color, but it now looks like there is a better chance to implement this first. A number of other issues will be possible to solve if we can separately adjust the rendering over land and water, including: #330, #621, #3840, #3851, #3864, #3877, #3926, #3894, and #3895 |
Unlikely i find the time this month - but not impossible. I have not forgotten this is one the list. However you are welcome to do this if you like to. |
I believe this issue is being held up by waiting for consensus on PR #4128 since it would affect implementation. We need to decide first if we are going to show a difference between rivers, lakes and seas, or continue rendering them all the same. |
In the context of reviewing layering, this would seem a good issue to revisit. It is linked to #4128, but it would seem relatively straightforward to make further adjustments, i.e. #4128 is not technically blocking. Unfortunately, I don't really understand what new things it would allow us to do. (This is separate from the topic of how it works, with the various comp-op's, which I don't clearly understand anyway). @imagico In the test rendering above can you clarify what is new / improved? Which issues would it unblock? |
The image above is just a technical demonstration. A practically more meaningful example is shown in #4513 (comment). With the current approach we essentially have the following options
Combining this with the use of patterns offers more choices - but is still severely constrained design wise. In particular since any use of transparency leads to a massive increase in the number of mixed colors, which impairs intuitive readability. Now with what has been suggested here you are completely free to separately design the appearance over water and land - at the cost of rendering things more than once and of additional code complexity. This allows in particular:
This offers much more design flexibility and thereby would allow better differentiating features over water - like wind parks or tidal zone features. See #3707, #3840, #3864, #4513. But all of this of course comes at the prince of a significantly more complex layer stack - owed to the limitations of Mapnik in compositioning. |
Many thanks for clarifying the issues involved. So, if I've understood correctly, we can and do achieve may of the renderings here using a landcover overlay e.g. so that From what I can gather, resolving this issue will be of most relevance to features in the tidal / coastal zone? For non-tidal water areas, mappers will typically create multipolygons e.g. for islands/other landcover within water areas. Would a useful way forward be to focus on the ocean water layer? I tried to work out how this was implemented in the AC-style, but it did seem to be quite complex, perhaps due to the need to handle intermittent/non-solid land-based water areas? This should reduce the layers to
This should reproduce the current rendering. The next question would be a good target for a differentiated rendering? |
By switching to water polygons for the coastlines (#3694) we are now able to better define what to show over water and can get a more consistent drawing order with ocean and polygon mapped waterbodies (like #1547).
What we so far still cannot do is separately design how things appear over water and over land. So far we use partly transparent patterns (beach, wetlands, reefs) and to a limited extent fill color transparency (tidalflats) to achieve some level of differentiation between land and water or in other words: for showing polygons crossing the water line while not completely obscuring the water line.
The price we pay for that is
The elegant solution to solve this is to use layer compositioning to render the water part separately from the land part. Currently all layers are rendered on top of what has been rendered before and the layer order is the following:
This would need to be modified the following way
This gives a lot of control but is of course technically somewhat more complicated. And apart from the additional landcover layer over water and the water color backdrop you need for any differentiation of water rendering (like not rendering all water in the same color) to render the features in question twice - once to cut out and then a second time for the differentiated backdrop.
Long story short - we need to consider if we want to do that. #3851 is the current case where this has significance, #3840 is another case where this kind of control could be useful. And the current use of transparency for tidalflat rendering could be avoided as well.
The text was updated successfully, but these errors were encountered: