gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 817 forks source link

Add rendering for natural=strait #804

Closed matthijsmelissen closed 5 years ago

matthijsmelissen commented 10 years ago

Straits are important landforms, some of them are very well known, e.g. Strait of Gibraltar or Strait of Magellan. Rendering them would be great. Right now, natural=strait is widely used, but often combined with place=locality, in order to force the rendering. place=locality could be avoided by rendering natural=strait directly.

See also https://trac.openstreetmap.org/ticket/4190.

imagico commented 10 years ago

This is closely related to #788 - ideally straits should get oriented labels of course.

matthijsmelissen commented 10 years ago

Any idea from which zoomlevel this should be rendered?

Bocche di Vulcano should probably only rendered from z13 or so.

The Canale di Sicilia could already be rendered from z7 or so.

Both are rendered as node - no way to distinguish them.

imagico commented 10 years ago

That varies strongly, some could well be shown already at z=3 or z=4 like

http://www.openstreetmap.org/node/305639213#map=4/65.22/-22.16 (node slightly misplaced here) http://www.openstreetmap.org/node/2049649009#map=4/64.66/-42.63 http://www.openstreetmap.org/node/1535090441#map=3/-53.23/-68.03 (not tagged as strait but would qualify) http://en.wikipedia.org/wiki/Fram_Strait (currently unmapped in OSM but could well be labeled at z=3)

A decision could be made based on proximity of the node to the coast but the coastline is not even in postgis...

dieterdreist commented 10 years ago

Il giorno 23/ago/2014, alle ore 16:01, imagico notifications@github.com ha scritto:

That varies strongly, some could well be shown already at z=3 or z=4

+1, I am not sure we should encourage mapping these as nodes, if we had polygons it would be easy to determine importance, but on nodes this is hopeless (and also more label dropping than actually "mapping")

matthijsmelissen commented 10 years ago

if we had polygons it would be easy to determine importance

Do straits have well-defined borders?

Skippern commented 10 years ago

@math1985 As I know, straits are considered sea-area, and are not well defined apart from the landscape formations creating them. I cannot see any sane way of mapping them as polygons.

The OpenSeaMap tagging scheme have a tag for strait, but I don't think it has many uses, though I believe they can tag it as an area. The limits of a sea-area strait would be its encounter with other sea-area such as between Strait of Gibraltar and Bay of Cadiz

imagico commented 10 years ago

@dieterdreist - I disagree here - based on the coastlines you can pretty well assess a strait from a node - in ambiguous cases a way along the strait can be a good idea but a polygon would be arbitrary and when used to rate importance it would be an invitation for manipulation.

The problem is the coastline is currently not available but this is just a limitation of the current rendering setup.

dieterdreist commented 10 years ago

Il giorno 23/ago/2014, alle ore 23:46, math1985 notifications@github.com ha scritto:

Do straits have well-defined borders?

The coastline is well defined, on the seaside there might be a gray area, but using a simple "straight" connection approximation would probably be sufficient for a rough area definition - surely much better than a dimensionless node, while maybe not really accurate (might be pretending a more defined border than there actually is).

I agree that generally there is a scale discrepancy between the osm model (scaleless in principle, but with a precision limit due to the amount of stored coordinate digits, in detailed areas maybe ~1:500 - 1:1000) and the scale in which straits are defined and thought of

gravitystorm commented 10 years ago

I favour polygons over nodes for large areas, even if the edges aren't particularly well defined. After all, why is http://www.openstreetmap.org/node/305639213#map=4/65.22/-22.16 correct and not 0.01 degrees to the left? Giving an area gives much more information and discourages people from putting nodes where they think the label should be shown.

imagico commented 10 years ago

The problem with polygons here is that they would ultimately always be wrong and painful in maintenance. Practical mapping uses almost exclusively nodes and lines. Imagining an archipelago with various straits and channels between the islands and all of them mapped as polygons makes me shudder - and there would be no additional useful information in a polygon - IMO it would essentially mean mappers doing additional work to make things easier for the computer rendering the map.

The key to prevent people from abusing nodes to manipulate label placement is to not use the node directly but only as a hint and infer the actual label location from the surrounding (in this case the coastline).

pnorman commented 10 years ago

The key to prevent people from abusing nodes to manipulate label placement is to not use the node directly but only as a hint and infer the actual label location from the surrounding (in this case the coastline).

I doubt we'd do that - see https://github.com/gravitystorm/openstreetmap-carto/blob/master/CARTOGRAPHY.md#data-manipulation

anderfo commented 8 years ago

What happened to this? Looks like it's still not rendered even at high zoom - being tagged on node, polygon or multipolygon...but on the "Humanitarian" layer it is rendered.

BTW I asked on the wiki/talk a few months ago about why a strait cannot be tagged as a line, while a valley can....no response yet: https://wiki.openstreetmap.org/wiki/Talk:Tag:natural%3Dstrait The geometry of a strait is rather similar to a valley. I'd still prefer polygons (or even multipolygons, although not permitted by the wiki), for the reasons mentioned by gravitystorm above.

imagico commented 8 years ago

The geometry of a strait is rather similar to a valley.

Actually no, a strait is a narrow between land masses, the best land analogy would be a saddle. Valley like straits are usually either submerged glacial troughs (i.e. fjords open at both ends) - like the Strait of Magellan or submerged river shaped valleys - like the Bosporus. The vast majority of straits are neither, they are usually just passages between islands or islands and continents.

Most of the big straits around the world are either mapped as nodes or as ways with 2-4 nodes where the location of the start and end node usually have no particular meaning, they essentially only specify direction:

http://www.openstreetmap.org/way/146655069 http://www.openstreetmap.org/way/146655079 http://www.openstreetmap.org/way/146655070

The problem here is not mapping, the problem is rendering in a way that does not give wrong incentives to mapping. If you look for example here:

http://overpass-turbo.eu/s/dGz

If you'd use the way length (or in case of area mapping the area size) for importance rating mappers would enlarge or shrink the features used for mapping to get the desired outcome - without any basis in reality. Actual importance of straits is best determined from their width and the size of islands or continents they separate.

dieterdreist commented 8 years ago

2016-01-12 12:17 GMT+01:00 Christoph Hormann notifications@github.com:

Actual importance of straits is best determined from their width and the size of islands or continents they separate.

actual importance is connected to the availability of alternatives but much more to the importance for trade / amount of traffic, e.g. the Bosporus is important because it's the only connection between the Black Sea and the Mediterranean Sea, the Strait of Hormuz is important because it's the only connection between the Persian Gulf and the Ocean and because there's a lot of oil to transport, if the ships were transporting sand or milk it would be much less important ;-)

tl;dr; importance is relying much more on different factors than what geometrically can be determined.

imagico commented 8 years ago

I am talking about cartographic importance as a natural, physical geography feature which has little connection with importance as a shipping route. The Fram Strait is a very important strait in terms of physical geography (probably second most important globally after the Drake Passage) but has zero significance as a shipping route.

dieterdreist commented 8 years ago

sent from a phone

Am 12.01.2016 um 13:18 schrieb Christoph Hormann notifications@github.com:

The Fram Strait is a very important strait in terms of physical geography (probably second most important globally after the Drake Passage) but has zero significance as a shipping route.

also close to zero importance for this style ;-) I'm interested in showing those straits that are important for a general map, like the strait of Gibraltar or the Bering Strait (no problem showing the Fram Strait, just that's not something I d consider prioritary)

imagico commented 8 years ago

Well - a world map showing the Bering Strait and Strait of Gibraltar but not the Fram Strait and Drake Passage would IMO be rather annoying and also counterproductive in terms of mapper feedback here.

anderfo commented 8 years ago

OK, maybe more similar to a saddle than a valley in some cases. But anyway it's a feature with some length and width which are both hard to define exactly. Cheating on length or area in order to trick the style sheet is also possible for a valley.

The idea of defining "strait importance" based on the width and size of islands or continents they separate is a possibility, although it's probably harder to implement than using a simple way length or area of the mapped feature. For a strait in a lake, the importance would of course have to be calculated in a different way (e.g. based on the size of the two bays/parts of the lake it connects). But I don't know if you have a different name for straits in lakes than in the sea. In my language they are identical.

imagico commented 8 years ago

A strait always has a width, usually well defined as the minimum distance between the land masses it separates but a length only in a few cases. You will have a hard time specifying a length for any of the straits shown in http://overpass-turbo.eu/s/dGz

My main point is that however straits are rendered in this style it should not be done in a way that requires mappers to map something non-verifiable.

For starters i think rendering straits as point labels on either nodes, ways or areas with a relatively high starting zoom level would already be an improvement. As directed point labels based on way direction, node with direction tag and area medial axis would be better. With coastline data in the database using the distance to the nearest coastline/lake outline to decide on the starting zoom level would be an option as well - although it would probably make more sense to do this as a preprocessing step for performance reasons.

mboeringa commented 8 years ago

The problem with polygons here is that they would ultimately always be wrong and painful in maintenance. Practical mapping uses almost exclusively nodes and lines. _Imagining an archipelago with various straits and channels between the islands and all of them mapped as polygons makes me shudder _- and there would be no additional useful information in a polygon

I agree polygons are not the best solution for straits, although features like fjords have been entered as such as well, but those are mostly better defined. Personally, allowing and using lines (non closed ways) as a rough baseline for labelling in my opinion would be the best option, and I support this in my personal ArcGIS Renderer by using them (in a similar way as for valleys and fjords). Yes, I know some of you are very much opposed to allowing mappers control of labelling or label positioning, but for these type of non very clearly defined features, I think it is the only viable option in the long run. It is not like natural features like straits, deserts and even valleys have a clear "fence" that delineates their exact boundary, like a fenced of garden...

The key to prevent people from abusing nodes to manipulate label placement is to not use the node directly but only as a hint and infer the actual label location from the surrounding (in this case the coastline).

This type of logic is virtually impossible to implement automatic, what you're asking is a "cartographers human intelligence / consciousness". I really don't see a viable option for this, and certainly none that doesn't suffer from a plethora of ambiguous results or outcomes of far to complicated routines.

If you'd use the way length (or in case of area mapping the area size) for importance rating mappers would enlarge or shrink the features used for mapping to get the desired outcome - without any basis in reality. Actual importance of straits is best determined from their width and the size of islands or continents they separate.

You are assuming the worst before its even proven to happen in reality. Most labelling results for points, lines and polygons I have seen for valleys and fjords in my personal ArcGIS Renderer, indicate users being fairly trustworthy...

Anyway, straits are non-delineable from the start, so how would you even judge the mappers were working "without any basis in reality"???

My main point is that however straits are rendered in this style it should not be done in a way that requires mappers to map something non-verifiable.

See my remark immediately above, I don't agree there is any way straits could be verifiable in the first place. They are just a stretch of water between some land masses with no defined begin or end point. Any approximate location of a strait's name should therefore do, as long as it doesn't enter into (also often approximate and ill defined) territory of another well known named water body.

kocio-pl commented 6 years ago

Any approximate location of a strait's name should therefore do, as long as it doesn't enter into (also often approximate and ill defined) territory of another well known named water body.

I agree. The level of precision and verifiability is not a golden standard for all the elements and scales. It's also not true that nodes are always better than areas, because you will not get the same position when next person will try to tag it. This kind of verifiability belongs not to the position and shape, but only to some easy named elements, like shop=convenience - but even then you might not be sure (speaking from experience - maybe it's rather shop=greengrocer or shop=alcohol?). So please, let rely a bit on the mappers in a grassroot project like OSM.

I think we could render them in the same way as bays - when tagged as ways they are related to an area (like any other water area), but when tagged as points they still get rendered, but quite late (like z14+).

DENelson83 commented 5 years ago

To render the name of a strait defined by an enclosed way or relation, why not just place it on the map at the single interior point which is the furthest away from any point on the boundary of the polygon? I don't know how you would implement that kind of method, but I thought I would just drop such an idea here.

kocio-pl commented 5 years ago

Thanks for dropping it here. You have just described the new Mapnik algorithm for placing labels inside polygons, so this is what would happen once this code is created: https://github.com/mapnik/mapnik/pull/3780.

The numbers of uses are raising quite fast this year and there are more lines and relations than nodes:

https://taginfo.openstreetmap.org/tags/?key=natural&value=strait

taghistory 46

DENelson83 commented 5 years ago

And in fact, I have made relations for every named body of seawater, both bays and straits, on the coast of British Columbia, except for those that the Canada–US border cuts through.

kocio-pl commented 5 years ago

Great!

Is anybody willing to make the code?