Open matthijsmelissen opened 10 years ago
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.
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.
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.
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.
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.
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.
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?
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.
Note that another way to implement something like this (without the problems raised on the discussion at https://github.com/gravitystorm/openstreetmap-carto/pull/3102 and https://lists.openstreetmap.org/pipermail/tagging/2018-March/thread.html#35347 ) would be if someone volunteered to enhance osm2pgsql to implement https://github.com/openstreetmap/osm2pgsql/issues/230 .
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:
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
z8 Timika, Papua 30 - note that one of the dashed province borders is tagged as maritime, but the vertical provincial border is not tagged.
b) Mix 35% admin-boundary color with 65% water color: z7 Merauke, Papua 35
z8 Timika, Papua 35
c) Mix 35% admin-boundary color with 65% (water-color darkened 30%) - my favorite z6 Papua 35-30
z7 Merauke, Papua 35-30
z8 Timika, Papua 35-30
Current master rendering for comparison: z6 Papua current
z7 Merauke current
z8 Timika current
I would like to submit a PR to address this, if it's okay to start a new one to replace PR #3102
I see that @matthijsmelissen actually considered this solution,maritime borders based on lines, on top of the full border based on the polygon: https://github.com/gravitystorm/openstreetmap-carto/pull/2950#issuecomment-364654454
There were also examples from Poland in this comment: https://github.com/gravitystorm/openstreetmap-carto/pull/2950#issuecomment-364704273
So my suggestion for a new PR would be very similar to the final commit of #2950
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.
@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.
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.
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?
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.
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.
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: