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

Restore linear coastline rendering #3926

Open
jeisenbe opened this issue Oct 9, 2019 · 13 comments
Open

Restore linear coastline rendering #3926

jeisenbe opened this issue Oct 9, 2019 · 13 comments
Labels

Comments

@jeisenbe
Copy link
Collaborator

jeisenbe commented Oct 9, 2019

Prior behavior

Between PR #3065 and PR #3694 (which reverted the prior PR while switching to ocean polygons), the oceans were outlined at z0 to z7. This was not done at higher zoom levels because it would lead to a line across river mouths and other places where inland water bodies meet the coastline. The coastline was also simplified to make this look better, which led to some problems: see #3695. But in PR #3694 we switched from land polygons to ocean polygons, and the outline was removed.

Proposed solution

It would be possible to restore the outline based on the water polygons, if we use comp-op: dst-out and comp-op: dst-over as discussed in #3854, and use a different color for oceans and rivers as discussed in #3895 and #3896 - this would allow drawing an outline or gradient around the oceans, without having this line overlap with the land at places where the coastline is deeply indented, in addition to other benefits. The line would not be more visible across river mouths, but will actually make the transition between rivers and ocean more subtle and subjectively pleasing (IMO).

The coastline outline could be in the same color as lakes or rivers, or a gradient made of 2 or 3 different colors that transitions between the ocean and river color.

This outline would somewhat emphasize small islands, so it would need to be small at lower zoom levels, but could be somewhat wider at high zoom levels.

Screenshots illustrating the idea:

z15 Age river mouth, Latvia - current
z15-age-before

z15 Age - Separate colors for ocean and rivers, 1 pixel wide outline for ocean
z15-age-lowcontrast-1pxoutline

z15 Age - 3 pixel gradient outline
z15-age-lowcontrast-3px

z17 before
z17-age-before

z17 1 pixel outline
z17-age-lowcontrast-1pxoutline

z17 3 pixel gradient
z17-age-lowcontrast-3px

Bremen, Germany

z13 Bremen 2px wide gradient
z13-bremen-2pixel-gradient
z14 Bremen 2px gradient
z14-bremen-weser-2pixel-gradient

z13 Bremen 1px gradient
z13-bremen-1pixel-gradient
z14 Bremen 1 px gradient
z14-bremen-1pixel-gradient

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Oct 9, 2019

Ardalstangen, Norway - current
z14
z14-ardalstangen-before
z15
z15-ardalstangen-before

3 water colors with 2 pixel outline in intermediate color:
z14 outline 2px
z14-ardalstangen-lowcontrast-2px-outline
z14 outline 2px
z15-ardalstangen-lowcontrast-2px-outline

Gradient
z14 gradient
z14-ardalstangen-lowcontrast-2px-gradient
z15 gradient
z15-ardalstangen-lowcontrast-3px-gradient

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Oct 9, 2019

Sogndal Norway - current z15
z15-sogndal-before

3 water colors
z15-sogndal-altcolors

1 pixel outline
z15-sogndal-altcolors-1px-outline

2 pixel outline
z15-sognda-altcolors-2px-outline

3 pixel gradient
z15-sogndal-altcolors-3px-gradient

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Oct 9, 2019

Another small advantage of using an outline is that man_made=pier features are now different than extensions of the coastline, in a subtle way:

z17 before - piers in Florø, Norway
z17-floro-piers-before
z17 with 3 pixel gradient for coastline
z17-floro-piers-3px-gradient

  • Now it's clear that the shape on the left side is a man_made=pier rendered over the ocean, not a part of the coastline that extends out, since that would have an outline around it.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Oct 9, 2019

Florø, Norway: lots of small islands and ferries. Here it's absolutely necessary to use dst-out to cut out the ocean before rendering the coastline behind the land, otherwise many of the outlines will overlap to adjacent islands or docks
https://www.openstreetmap.org/#map=14/61.6008/5.0304

z13 before
z13-floro-before

z14 before
z14-floro-before

z13 after 1 pixel gradient
z13-floro-1px-gradient

z14 after 1 pixel gradient
z14-floro-1px-gradient

z13 with 2 pixel gradient
z13-floro-2px-gradient

z14 with 2 pixel gradient
z14-floro-2px-gradient

z13 with 3 pixel gradient
z13-florelandet-3px-gradient

z14 with 3 pixel gradient
z14-floro-3px-gradient

@jeisenbe jeisenbe added the water label Oct 9, 2019
@kocio-pl
Copy link
Collaborator

kocio-pl commented Oct 9, 2019

I like the 3 px gradient version the most and would be happy to see the outline again, especially on higher zoom levels.

@imagico
Copy link
Collaborator

imagico commented Oct 9, 2019

First of all this is not what you'd normally call an outline. The line is fully on the water side of the coastline. This is of fundamental importance to keep in mind i think because if you render this in a styling that looks like an outline it would leave a biased impression of the coastline being further to the water side than it actually is.

There are two big things that are unclear to me so far:

  • what is the specific intention of this change, in what way is it supposed to improve the map?
  • at what zoom levels is this going to be used?

Since you use colors for this edge rendering that are identical or similar to other water colors you use keep in mind there might be a significant risk that the edges are mistaken for mapped geometries (like waterways or narrow water polygons) and this could negatively affect mapper feedback and readability in general. This of course depends on the zoom level range where this is to be shown.

@jeisenbe
Copy link
Collaborator Author

jeisenbe commented Oct 9, 2019

this is not what you'd normally call an outline. The line is fully on the water side of the coastline

True. It's sort of like an outline of the land (not the water), but it's more correct to say that it's slightly increasing the saturation and darkness of the water pixels nearest the coastline.

What should I call it in the title of this issue? "Linear coastline rendering"? "Coastline gradient?"

what is the specific intention of this change, in what way is it supposed to improve the map?

If we implement #3854 then we will have a different rendering for areas mapped as beach, shoal, reef, etc which are outside of the coastline. This proposed rendering will help make it clear where the coastline (mean high water spring line) is located within these features.

It also makes it easier for map users to visually follow the coastline when there are changing landcover features next to it, or many small inlets or peninsulas.

This also has the effect of highlighting the location of islets and islands, which might otherwise be missed then they are just a couple of pixels in size.

at what zoom levels is this going to be used?

At lower zoom levels only a very narrow line/gradient can be used, otherwise small islands are overemphasized. But a 0.5 pixel wide line works even at low zoom, in my tests. At higher zoom levels a wider gradient could be used

significant risk that the edges are mistaken for mapped geometries (like waterways or narrow water polygons)

Right, that's why we shouldn't use anything wider than pixel at low-mid zoom levels, and a 2 or 3 pixel gradient is the max that is feasible at high zoom levels. We don't want a tidal channel or narrow inlet to look like a river or canal.

@jeisenbe
Copy link
Collaborator Author

No line/gradient (for comparison):
z4
z4-europe-no-line
z5
z5-north-sea-no-line

0.5 pixel:
z4-europe-half-px-gradient
z5-north-sea-half-px-gradient

1.0 pixel gradient:
z4-europe-1px-gradient
z5-north-sea-1px-gradient
I think 1 pixel just works, but it's debatable at z4 especially, where the coastline/water polygons are one of only a few features shown.

1.5 pixel gradient:
z4-europe-1andhalf-px-gradient
z5-north-sea-1andhalf-px-gradient
Even just 1.5 pixels is too much at z4, where no landcover is shown. At z5 it's probably still too wide, though we would need to test on a server that can handle rendering a large area.

@imagico
Copy link
Collaborator

imagico commented Oct 10, 2019

Your sample images here (and elsewhere) vary in overall coloring in a way that is quite clearly not intended. That probably is due to the usual PNG metadata and the way browsers process that. This can be a cause for a lot of confusion when discussing colors so you should make sure you process all your sample images exactly identically.

If we implement #3854 then we will have a different rendering for areas mapped as beach, shoal, reef, etc which are outside of the coastline. This proposed rendering will help make it clear where the coastline (mean high water spring line) is located within these features.

But the whole idea of separately adjusted rendering of beach, shoal etc. is that they are equally recognizable and the water line is equally recognizable on all kinds of waterbodies. If you now add a special edge rendering to ocean only that would only affect the ocean case and i think that would kind of counteract the whole idea and would make reading the map more confusing.

In any case wouldn't that be something better to discuss after we have implemented these things?

It also makes it easier for map users to visually follow the coastline when there are changing landcover features next to it, or many small inlets or peninsulas.

Following the coastline yes, but i am not sure this is actually that beneficial.

This also has the effect of highlighting the location of islets and islands, which might otherwise be missed then they are just a couple of pixels in size.

Yes, for the lower zoom levels i think that would indeed be a clear benefit.

Right, that's why we shouldn't use anything wider than pixel at low-mid zoom levels, and a 2 or 3 pixel gradient is the max that is feasible at high zoom levels. We don't want a tidal channel or narrow inlet to look like a river or canal.

But increasing the line width with the zoom level could further emphasize the impression that it is actually a mapped geometry.

If i take your last example from z5 - we currently have no meaningful inland waterbody rendering at this scale but if we had and we also had differentiated coloring for different classes of waterbody this kind of edge rendering would obscure the color differentiation and it would not be clear if some coastal water area (like a small inlet) is mapped as inland water or if it is just the highlighted outline that creates this impression.

The only way to avoid this would be to use a color for the edge rendering that is distinctly different from all the water fill colors. And that would probably make it look like an actual outline with the mentioned problem of creating a biased impression.

@jeisenbe jeisenbe changed the title Restore ocean outline Restore linear coastline rendering Oct 10, 2019
@jeisenbe
Copy link
Collaborator Author

Your sample images here (and elsewhere) vary in overall coloring

Sorry. They were made with different colors for the ocean. Since this issue is just about the idea, I included test images with two different ocean colors and a couple different gradient and outline ideas.

If you now add a special edge rendering to ocean only that would only affect the ocean case and i think that would kind of counteract the whole idea and would make reading the map more confusing.

The oceans are the main water bodies which are strongly effected by the daily tides, so the high tide line vs low tide line distinction is more significant for features along the coastline compared to the edges of lakes or rivers where variations in water level are either seasonal or ephemeral.

wouldn't that be something better to discuss after we have implemented these things

Yes.

Following the coastline yes, but i am not sure this is actually that beneficial.

It helps improve mapper feedback if mappers can clearly see the position of the coastline. And since the shape of the coastline is the most recognizable feature for most areas of land near the coast, being able to see the coastline clearly is also helpful for general map users to be able to quickly recognize places on the map.

increasing the line width with the zoom level could further emphasize the impression that it is actually a mapped geometry.

Right, it should not be increased by more than 50% between zoom levels (unless it's sub-pixel width). Progression could be 0.5 px -> 1.0 px -> 1.5 px -> 2.0 px -> 3.0 px (or stop at 2.0)

t would not be clear if some coastal water area (like a small inlet) is mapped as inland water or if it is just the highlighted outline

For areas less than the width of the coastline rendering (1 to 2 pixels depending on zoom level) it won't be clear if it's a river mouth or fjorde or mis-tagged. But it will not really be clearly visible for such narrow features even without the linear coastline rendering. Zooming in would be necessary in either case.

@jeisenbe
Copy link
Collaborator Author

@matthijsmelissen, @kocio-pl, @pnorman - you all approved #3065 "Give oceans outline and simplify shapefiles on z0-7". What benefits did you see?

@imagico
Copy link
Collaborator

imagico commented Oct 10, 2019

The oceans are the main water bodies which are strongly effected by the daily tides, so the high tide line vs low tide line distinction is more significant for features along the coastline compared to the edges of lakes or rivers where variations in water level are either seasonal or ephemeral.

But you realize that especially in that case a constant width gradient might easily be mistaken for an actual mapping of the tidal range.

It helps improve mapper feedback if mappers can clearly see the position of the coastline

But it does not necessarily do that since the line has an offset. It might emphasize visibility of the coastline if the contrast between land and the emphasized edge is stronger than between land and the ocean fill color. But the same effect could then also be achieved without the other problems by changing the ocean fill color overall.

@jeisenbe
Copy link
Collaborator Author

One other reason to use different colors for ocean and rivers: it is not possible to make a nice looking linear or gradient rendering along the ocean side of the coastline otherwise.

But we still need some more arguments in favor of this idea - @matthijsmelissen, @kocio-pl, @pnorman, what was the reasoning back when #3065 was approved?

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

3 participants