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

Maritime borders too prominent #621

Open
matthijsmelissen opened this issue Jun 10, 2014 · 17 comments
Open

Maritime borders too prominent #621

matthijsmelissen opened this issue Jun 10, 2014 · 17 comments

Comments

@matthijsmelissen
Copy link
Collaborator

Maritime borders are currently rendered too prominent. This makes the map look ugly. No other map I know off renders maritime borders.

We should either:

@23cpo
Copy link

23cpo commented Jun 10, 2014

how would someone see to which country this island [1] belongs when we drop rendering of maritime boundaries?

[1] http://www.openstreetmap.org/#map=13/38.4290/26.0419

The french mapstyle renders maritime boundaries in blue: http://openstreetmap.fr/calendrier#zoom=11&lat=41.39467&lon=31.49076&layers=B0TTT
I don't know if that's better.

@imagico
Copy link
Collaborator

imagico commented Jun 11, 2014

A reasonable solution would be to only show maritime boundaries between different national entities and not render those towards the open ocean. Not sure if there is a smooth way to determine this from the database though.

@hlaw
Copy link

hlaw commented Jun 11, 2014

We should either:
Drop rendering maritime borders altogether (see https://trac.openstreetmap.org/ticket/2249)
Render them in a less obtrusive color, for example navy blue (see https://trac.openstreetmap.org/ticket/3206)

or rendering them only at higher zoom level as in the french mapstyle.

In many parts of the world the maritime boundaries in osm only serve the purpose of closing the country polygons. More often they neither reflect territorial claims nor actual control - and edit wars resulted when someone tries to reflect claims on osm.

When maritime boundaries face upon open ocean, there may also be different interpretations for what it means.

The current set of maritime boundaries are somewhat problematic -

Given the controversial nature there seems no hope of getting these consistent in the data. Rendering them as subtle as possible while retaining the feedback loop at higher zoom level should be an improvement.

@Skippern
Copy link

I remember old Norwegian paper maps displaying maritime portion of national boundary with a thin blue symbol with interval, so that you could gather from the map where it was, but not drawing attention to it.

@kocio-pl
Copy link
Collaborator

I also like this feature, but it really doesn't need to be so visible. Looks like another item for planned general low zoom refreshment.

@nebulon42
Copy link
Contributor

I was experimenting how we could get rid of maritime boundaries, but it is not that easy. I think it might not be possible without some database-level preprocessing.

boundaries_wo_maritime

The approach I used tried to remove the portions from boundaries that are tagged as maritime. There are still some artefacts remaining (see e.g. Gulf of Sidra, bottom center in the preview) which I cannot explain. For reference the query that I used:

        (SELECT
            COALESCE(ST_Difference(a.way, 
              (SELECT ST_Union(ST_Buffer(b.way, 5))
               FROM planet_osm_roads b
               WHERE ST_Intersects(a.way, b.way)
                 AND a.osm_id != b.osm_id
                 AND b.boundary = 'administrative'
                 AND b.admin_level IN ('0', '1', '2', '3', '4')
                 AND b.tags->'maritime' = 'yes'
                 AND b.osm_id > 0)
              ), a.way) as way,
            admin_level
          FROM planet_osm_roads a
          WHERE a.boundary = 'administrative'
            AND a.admin_level IN ('0', '1', '2', '3', '4')
            AND a.osm_id < 0
          ORDER BY admin_level DESC
        ) AS admin_low_zoom

Needless to say that the performance is quite bad. Why did I choose such a complicated approach?

Up until now we rendered both ways tagged as boundaries and ways derived from relations. #1938 tries to change that to relation-derived only rendering. In contrast osm-fr renders only ways tagged as boundaries, which makes it easier to get rid of maritime borders. But on the other hand this leads to a lot of missing boundaries as http://tile.openstreetmap.fr/?zoom=5&lat=57.99256&lon=32.91573&layers=B0000000FFFFFFF shows in e.g. Russia, Poland and Finland.

So the only feasible way I can think of to tackle this is some preprocessing. Is there a way to make sure that admin boundaries from relations remain as individual ways but get all the tags from the relation? @pnorman Would your ClearTables approach be capable of that? Or any other Lua transformation?

@imagico
Copy link
Collaborator

imagico commented Nov 21, 2015

It seems what would be needed here is relation membership info of ways in the database (which would also help other things like #596) - this way you could easily do what you are trying to do without resorting to ST_Intersects(). You could also use the approach i suggested (i.e. detect maritime boundaries as those only part of one boundary relation).

Apart from the national maritime boundaries the French style by the way also specially treats subnational boundaries which are identical to the coastline. This however only works when the coastline tag is actually on the boundary ways (and not just two ways sharing nodes). For a preprocessing approach this is actually the much harder part than the national maritime boundaries.

matthijsmelissen pushed a commit to matthijsmelissen/openstreetmap-carto that referenced this issue Nov 20, 2017
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes gravitystorm#621
* This possibly impacts solutions to gravitystorm#723, #2234m and gravitystorm#2663.
matthijsmelissen pushed a commit to matthijsmelissen/openstreetmap-carto that referenced this issue Feb 5, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes gravitystorm#621
* This possibly impacts solutions to gravitystorm#723, #2234m and gravitystorm#2663.
matthijsmelissen pushed a commit to matthijsmelissen/openstreetmap-carto that referenced this issue Feb 16, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes gravitystorm#621
* This possibly impacts solutions to gravitystorm#723, #2234m and gravitystorm#2663.
matthijsmelissen pushed a commit to matthijsmelissen/openstreetmap-carto that referenced this issue Mar 10, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes gravitystorm#621
* This possibly impacts solutions to gravitystorm#723, #2234m and gravitystorm#2663.
matthijsmelissen pushed a commit to matthijsmelissen/openstreetmap-carto that referenced this issue Mar 10, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes gravitystorm#621
* This possibly impacts solutions to gravitystorm#723, #2234m and gravitystorm#2663.
@SomeoneElseOSM
Copy link
Contributor

Note that another way to implement something like this (without the problems raised on the discussion at #3102 and https://lists.openstreetmap.org/pipermail/tagging/2018-March/thread.html#35347 ) would be if someone volunteered to enhance osm2pgsql to implement osm2pgsql-dev/osm2pgsql#230 .

matthijsmelissen pushed a commit to matthijsmelissen/openstreetmap-carto that referenced this issue Apr 12, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes gravitystorm#621
* This possibly impacts solutions to gravitystorm#723, #2234m and gravitystorm#2663.
matthijsmelissen pushed a commit to matthijsmelissen/openstreetmap-carto that referenced this issue Apr 12, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes gravitystorm#621
* This possibly impacts solutions to gravitystorm#723, #2234m and gravitystorm#2663.
matthijsmelissen pushed a commit that referenced this issue May 8, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes #621
* This possibly impacts solutions to #723, #2234m and #2663.
matthijsmelissen pushed a commit that referenced this issue May 8, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes #621
* This possibly impacts solutions to #723, #2234m and #2663.
matthijsmelissen pushed a commit that referenced this issue May 8, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes #621
* This possibly impacts solutions to #723, #2234m and #2663.
matthijsmelissen pushed a commit that referenced this issue May 8, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes #621
* This possibly impacts solutions to #723, #2234m and #2663.
matthijsmelissen pushed a commit that referenced this issue May 8, 2018
This requires rendering admin boundaries based on the individual
lines, rather than the entire polygons.

* This fixes #621
* This possibly impacts solutions to #723, #2234m and #2663.
@jeisenbe
Copy link
Collaborator

jeisenbe commented May 5, 2019

Now that we have water polygons to render the oceans, there are several options to solve this.

1) Hide maritime borders completely by rendering administrative boundaries above landcover, lakes and rivers but below the ocean.
Advantage: easy, doesn't require checking for maritime tags.
Disadvantage: mappers no longer get feedback about the shape of maritime borders.

Conclusion: we could consider this option at low zoom levels, eg z4 to z6, since currently at z1 to z3 only land borders are shown, but at mid and low zoom levels we need to show the maritime borders for the sake of mapper feedback.

Example: z6 Papua, Indonesia with borders rendered under the ocean polygons:
z6-papua-borders-under-ocean

2) Render maritime borders less prominently. Continue to render the main administrative-boundaries from the polygons, but use the lines to render just the maritime boundaries based on the presence of maritime tags. This option will work for high zoom levels as well, since it continues to render all borders that are mapped as relations, as well as showing maritime borders separately when the individual ways have been tagged. If the maritime tags are missing (rare on national borders, but seen on some province or lower-level borders in some countries), then the rendering is unchanged.

This has been shown by @imagico in the alternative-colors style

a) 30% darker than water-color (like in PR #3102)
z7 Merauke, Papua 30
z7-merauke-maritime-water30darker

z8 Timika, Papua 30 - note that one of the dashed province borders is tagged as maritime, but the vertical provincial border is not tagged.
z8-timika-maritime-water30percent

b) Mix 35% admin-boundary color with 65% water color:
z7 Merauke, Papua 35
z7-merauke-maritime-35percent

z8 Timika, Papua 35
z8-timika-maritime-35percent

c) Mix 35% admin-boundary color with 65% (water-color darkened 30%) - my favorite
z6 Papua 35-30
z6-papua-maritime-mix-30-35

z7 Merauke, Papua 35-30
z7-merauke-maritime-mix-30-35

z8 Timika, Papua 35-30
z8-timika-maritime-mix-30-35

Current master rendering for comparison:
z6 Papua current
z6-papua-maritime-master

z7 Merauke current
z7-Merauke-maritime-master

z8 Timika current
z8-Timika-maritime-master

I would like to submit a PR to address this, if it's okay to start a new one to replace PR #3102

@jeisenbe
Copy link
Collaborator

jeisenbe commented May 5, 2019

I see that @matthijsmelissen actually considered this solution,maritime borders based on lines, on top of the full border based on the polygon: #2950 (comment)

There were also examples from Poland in this comment: #2950 (comment)

So my suggestion for a new PR would be very similar to the final commit of #2950

@imagico
Copy link
Collaborator

imagico commented May 5, 2019

Please note #3102 (comment).

@jragusa
Copy link
Contributor

jragusa commented May 10, 2019

Having a different colour for maritime borders would simplify any further modification of colour for terrestrial boundary because we will not have to check on both backgrounds.

@jeisenbe
Copy link
Collaborator

jeisenbe commented Apr 4, 2020

@imagico - if we implement #3854 would it still be recommended to interpret maritime=yes for the maritime borders rendering, or should we just use the relations for all of them?

I'm wondering if I can implement this now, or if #3854 needs to be done first.

@imagico
Copy link
Collaborator

imagico commented Apr 4, 2020

I think #3854 will not work for the administrative boundaries since those come very late in our layer stack and it would be prohibitively complex and expensive to use that technique.

There are essentially two options here from my point of view - using the boundary ways and maritime=yes (which is obviously incompatible with using line simplification on the polygons) and using preprocessed data. When using the comp-op: darken technique i suppose you could also use single layer compositioning as it is done right now - but that would depend on #4092. And it would mean certain design constraints of course.

@jeisenbe
Copy link
Collaborator

jeisenbe commented Apr 4, 2020

you could also use single layer compositioning as it is done right now - but that would depend on #4092

How does that depend on #4092?

@imagico
Copy link
Collaborator

imagico commented Apr 4, 2020

The current boundary drawing technique uses white lines to erase previously drawn boundaries and then comp-op: darken to draw the result. In a similar fashion you could erase the maritime part of the boundaries by drawing the ocean polygons in white over them. But that would require having them available in PostGIS so you can draw them in the same layer.

@pnorman
Copy link
Collaborator

pnorman commented Jul 8, 2022

A reasonable solution would be to only show maritime boundaries between different national entities and not render those towards the open ocean. Not sure if there is a smooth way to determine this from the database though.

#4431 will add this ability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment