gravitystorm / openstreetmap-carto

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

Add rendering for natural=valley labels #788

Open matthijsmelissen opened 10 years ago

matthijsmelissen commented 10 years ago

The following issue has been moved over from trac:

The following are all tags used for common natural features in Iceland (and probably elsewhere) on nodes (along with place=locality to get them to render). They're traditionally rendered as plain text on maps:

The list is ordered roughly by how prominent each should be on the map. But of course these things can differ wildly.

jeisenbe commented 4 years ago

offset the label so it doesn't overlap the watercourse.

Generalization is a great idea for map legibility, but another very important goal of this style is mapper feedback, and for that it is important for the precise geometry to be shown. That's why we don't move overlapping roads along rivers. Also the processing would be somewhat computationally expensive, and the more complex code would be harder to edit and maintain

imagico commented 4 years ago

Independent of the questions if there is a consistent and verifiable mapping of valleys at the moment i would - like in case of polygons - be very much against labeling linear ways without providing feedback on the geometry and its extent. That would incentivize drawing of non-verifiable labeling geometries.

jeisenbe commented 4 years ago

As mentioned above, my suggestion is to render a horizontal text label at the center point of the natural=valley way only.

The only possible use of the line length would be to stop rendering valleys which were clearly much larger than the usual screen size. All would start rending at the same zoom level.

If this isn't feasible, we could only render labels on nodes. At least in that case it would incentivize using natural=valley instead of a place=locality node, and would get us a step closer to removing the rendering of place=locality.

imagico commented 4 years ago

As mentioned above, my suggestion is to render a horizontal text label at the center point of the natural=valley way only.

The only possible use of the line length would be to stop rendering valleys which were clearly much larger than the usual screen size. All would start rending at the same zoom level.

I see - i am doubtful about the usefulness of that regarding the goals of this style. Even if i imagine that tag was consistently used on linear ways in some form (which is purely wishful thinking) that would only lead to a meaningful labeling at a very small range of zoom levels and what range that is depends a lot on the circumstances. There are valleys that are in size of the order of a few hundred meters while there are also valleys of a few hundred kilometers. The range of sensible zoom levels for those two does not even overlap.

jeisenbe commented 4 years ago

there are also valleys of a few hundred kilometers

Fortunately, very few of these are mapped as ways in Openstreetmap. I haven't found any so far in the dozen areas that I have looked at.

There are valleys that are in size of the order of a few hundred meters

Most valleys which I have checked are in this range of a few hundred meters to a few kilometers.

Many areas have no natural=valley features mapped, e.g. most developing countries which I checked, and flat areas like most of the Netherlands and Delaware. Also most US states and Canadian provinces do not have any valleys mapped yet.

However, there are some mountainous and hill areas where they are commonly used.

Of the places I have downloaded, Burgenland in eastern Austria and Hautes Alpes in France have the most valleys, and fortunately they are fairly consistently used there. Some regions of Spain also have a number of valleys, though these are often very coarselly mapped with just 2 to 4 nodes, but I'm still happy to encourage tagging these, rather than using locality for all small unpopulated place names (very common in France and Spain).

jeisenbe commented 4 years ago

In these test images I've rendered the valley name label on the center of the line (or on the node) with landform-color (same as peaks/saddles), and rendered a thin landform-color line along the way, if there is one, to show the underlying data. This is not a proposed rendering, but a way to show what the data looks like. Testing at z14 since that would be the earliest to show these features (thoug z15 would be consistent with ridges, aretes and cliffs).

Hautes Alpes

https://www.openstreetmap.org/#map=14/44.4583/6.5547 valleys-france-14:44 4583:6 5547

https://www.openstreetmap.org/#map=15/44.8117/6.7131 valley2-france-15:44 8117:6 7131

https://www.openstreetmap.org/#map=15/44.8117/6.7131

https://www.openstreetmap.org/#map=15/44.6942/5.8519

valley-france-14:44 6942:5 8519

== Burgenland ==

https://www.openstreetmap.org/#map=14/47.8852/16.5819 valleys-more-burgen-14:47 8852:16 5819

https://www.openstreetmap.org/#map=14/47.8828/16.5008] valleys-many-burgen-14:47 8828:16 5008

https://www.openstreetmap.org/#map=14/47.4354/16.2099 valley-stream-burgen-14:47 4354:16 2099

https://www.openstreetmap.org/#map=14/47.3785/16.3751 valleys-4-burgen-14:47 3785:16 3751

https://www.openstreetmap.org/#map=15/47.3355/16.3519 valleys-3-burgenland-15:47 3355:16 3519

== Asturias, Spain ==

https://www.openstreetmap.org/#map=14/43.2623/-4.8033 valley-canal-lilamedu-14:43 2623:-4 8033

At z16 lots of place=locality features are visible nearby valley-canal-lilamedu-16:43 2623:-4 8033

https://www.openstreetmap.org/#map=14/43.1975/-4.7749

valley-monetas-16:43 1975:-4 7831

https://www.openstreetmap.org/#map=15/43.1951704/-5.2233951

https://www.openstreetmap.org/#map=14/43.3719/-4.8662

jeisenbe commented 4 years ago

There are a few valleys mapped in Tasmania, Wales and Hawaii, though many other English-speaking areas do not have any mapped yet.

== Tasmania ==

https://www.openstreetmap.org/#map=14/-43.6010/146.8627

https://www.openstreetmap.org/#map=14/-41.6632/145.9525 Marigold valley - rather small, perhaps it is a ravine? marigold-valley-14:-41 6632:145 9525

marigold-valley-15:-41 6632:145 9525

https://www.openstreetmap.org/#map=14/-41.8186/146.3115

https://www.openstreetmap.org/#map=14/-41.9200/146.1540 valley-never-never-14:-41 9200:146 1540

== Wales ==

https://www.openstreetmap.org/#map=15/51.9998/-4.6185 z15-valley-wales-15:51 9998:-4 6185

https://www.openstreetmap.org/#map=14/52.0590/-4.6242

== Hawaii ==

https://www.openstreetmap.org/#map=16/23.0581/-161.9168

https://www.openstreetmap.org/#map=15/20.0296/-155.8133

https://www.openstreetmap.org/#map=14/21.8934/-160.0998

jeisenbe commented 4 years ago

Besides the 2 really big valleys that I mapped here in Papua, the only really large valleys I have found so far are in Norway - partially they appear big due to the high lattitude. Here are there some that really should be shown at z12 or z13.

== Norway, Sogn og Fjordane ==

https://www.openstreetmap.org/#map=14/61.4989/8.3040

norway-valley-node-Opentopomap

Most of the ways are 5 to 20 kilometers long (22/35), like these. The very longest is 38 but includes part of a fjord: only 5 are over 20km.

https://www.openstreetmap.org/#map=14/61.4749/8.2782 norway-valley-way-long-14:61 4749:8 2782

https://www.openstreetmap.org/#map=14/61.4825/7.9626 norway-valley-long-14:61 4825:7 9626

https://www.openstreetmap.org/#map=14/61.4640/8.0680 norway-valley-long-14:61 4640:8 0680

But there are 8 that are less than 5 kilometers long, (about 1/4) eg: https://www.openstreetmap.org/#map=14/61.9903/6.4627 norway-short-valley-14:61 9903:6 4627

jeisenbe commented 4 years ago

=== Analysis of all natural=valley ways === I downloaded all 11,106 natural=valley ways with name=* tags - ouch, that was 49 megabytes.

2495 have a waterway= tag (mostly waterway=stream), but most of these are waterway=drystream (stream is the next most at 846). Also, 1547 of these are all in one small region of Russia(?) centered on 50.8797426, 40.1522567, most added by User:keder in 2016-17

No other combinations are very significant.

The median natural=valley way is 1281 meters long, according to JOSM.

So a super-majority (70%) are between 0.4 kilometers and 5 kilometers in length, and 80% are 300m to 8km in length

The middle 46% are between 0.5 and 2.0 kilometers: only 2 zoom levels difference.

=== Conclusion ===

I think we can consider rendering these features by focusing on the majority that are a couple hundred meters to a few kilometers in length (and also the small number of nodes should be rendered).

Unfortunately I do not have any good ideas for a linear representation. Since these are not usually nodes, a point icon (like natural=saddle) would not be appropriate.

So I am planning to just render the name at the center, though probably in gray rather than landform-color.

jeisenbe commented 4 years ago

I believe a gray label is the best option. While I considered something similar to the landform-color text labels used for peaks and saddles, that is matching an icon.

As a text label only it might make more sense to match the place=locality, place=island and natural=cape labels, and natural=ridge / natural=arete which are gray.

Options:

1) Brown labels (based on landform-color) valleys-after-brown-14:44 4596:6 5612

valley-vs-ridge-france-15:45 0822:6 3171

2) Gray labels, oblique valleys-after-gray-oblique-14:44 4596:6 5612

martignare-valley-ridge-gray-oblique

3) Gray labels, standard (book-fonts) valleys-after-gray-book-14:44 4596:6 5612

martignare-valley-ridge-15-gray-book

jragusa commented 4 years ago

Grey label with standard font would be consistent with ridge names. I also notice that natural=cape is labelled in black colour, do we need to have two colours for natural features ?

imagico commented 4 years ago

So a super-majority (70%) are between 0.4 kilometers and 5 kilometers in length, and 80% are 300m to 8km in length

The middle 46% are between 0.5 and 2.0 kilometers: only 2 zoom levels difference.

It is natural for this kind of feature there are a large number of smaller ones and only very few larger ones. But that does not mean there are no larger ones. Like:

https://www.openstreetmap.org/way/374056124 https://www.openstreetmap.org/way/539764751 https://www.openstreetmap.org/way/706934555 https://www.openstreetmap.org/way/539763901

Overall i have strong doubts about the kind of labeling you suggest. The main problem with the current mapping of natural=valley is that there is no consistency in the geometries. The suggested labeling would not help changing that because the mapper will get feedback about having done something right (by there appearing a label) but that positive feedback will appear no matter how they draw the line. At the same time the benefit for the map usefulness seems rather small by placing a point label somewhere along the mapped geometry.

jeisenbe commented 4 years ago

So you would only be in favor of labeling these if we also show the line?

I haven't been able to find examples online of linear representations for valleys. Probably in modern maps it is assumed that shading and contour lines are used instead.

Any ideas on how it might be done?

imagico commented 4 years ago

So you would only be in favor of labeling these if we also show the line?

No, even if there was a good way to do that - mapping lacks the consistency for this to make sense.

It seems to me that most of the natural=valley geometries in the database were created to generate a certain result in maps which render labels for those. This is in particular cases where mappers draw the lines with a deliberate offset to place an offset label.

We could of course do the same and offer mappers the option to directly draw labels in our map. But i don't think this is the responsible thing to do.

Ultimately it is not within our mandate to tell mappers actively how they are supposed to map valleys. Therefore i think the only thing we can say at the moment is that the current way these are mapped does not work and we therefore can't support it.

eehpcm commented 3 years ago

I just noticed that OpenTopoMap renders valleys. I'm not saying it's the way to go (especially as I don't know how much computational load their approach requires) but it gives an example of how it could be done.

z=16 z=17

I think it looks acceptable. We might quibble over the text colour for consistency with other features, but apart from that I think it looks OK.

BTW, would a river gorge be considered natural=valley or should it be natural=gorge? If the latter, would code be added to render natural=gorge if code is added for natural=valley?

Ircama commented 3 years ago

I also considered this topic in the past and as far as I remember the reason why valley is not currently rendered in openstreetmap-carto is due to the lack of verifiability in the valley definition (as with other geographical features in OpenStreetMap). For instance, currently its data model does not support intersecting a house with a valley to check whether that house is inside a valley.

Discussions on data models are common to other geographical features in OpenStreetMap, where unfortunately geometry is not yet agreed and related arguments do not provide improvements.

Designing an acceptable geometry for valleys (e.g., whether a valley shall be represented through its thalweg or it is an area) is needed before considering its rendering here. At least this looks the spirit of the maintainers of openstreetmap-carto, the official OpenStreetMap rendering, possibly also as an incentive to improve arguable data models of some OpenStreetMap features.

Platforms like OpenTopoMap and Osmand, which are not official even if remarkable, decided to render valleys and many other geographic features based on current definitions, also in case they are more oriented to directly draw a label with the current renderers than describe the feature.

eehpcm commented 3 years ago

Designing an acceptable geometry for valleys (e.g., whether a valley shall be represented through its thalweg or it is an area) is needed before considering its rendering here. At least this looks the spirit of the maintainers of openstreetmap-carto, the official OpenStreetMap rendering, possibly also as an incentive to improve arguable data models of some OpenStreetMap features.

In this thread there have been many reasons put forward why valleys cannot be rendered, or should not be rendered, or must not be rendered. One of the arguments was along the lines of "Even if we could rigidly define how to map a valley as a way, there is no good way of rendering it because reasons."

I think OpenTopoMap has shown that it is possible to adequately render a valley mapped as a way, even when the label partially obscures the associated river.

Now we can move onto the arguments about accuracy and definitions (and even thalwegs, if you insist). To which i'll respond that everything we map is an approximation and we understand that when better aerial imagery, or better GPS traces or whatever come along then we refine that approximation. If we insist that we must not map something unless we can map it perfectly then we can all give up an go home.

Ircama commented 3 years ago

In this thread there have been many reasons put forward why valleys cannot be rendered, or should not be rendered, or must not be rendered. One of the arguments was along the lines of "Even if we could rigidly define how to map a valley as a way, there is no good way of rendering it because reasons."

I am generally in favor to see names of valleys rendered, together with other mountain features and I have tried to summarize the essence of the issue as I understand it.

ppete2 commented 10 months ago

I wish to see valleys rendered too. Valleys are an important topological feature, which are in frequent use in talks, newspapers etc.

Btw: On the very top of this issue it's written "Fixed by #941" . Could this be deleted, cause the issue isn't fixed at all.

dch0ph commented 7 months ago

I suspect that rendering valley names will look odd in a non-topographic map like Carto.

It can work if you have contours / hill-shading. Here a Carto-derivative where valley names are only rendered at Z11 and Z12: Z12: image Z13: image

The valley name would interfere with the extra detail that appears at Z13.

gylfiolafsson commented 2 days ago

I would revive this thread in support of rendering valleys. Here are three reasons:

  1. In Iceland, as in many other countries of similar geology, valleys are very highly-ranked as geographical features that are used in everyday speech. Minor issues with rendering should not come in the way of showing these features on maps.

  2. Looking at data on number of tags, we can see that in the 10 years since this thread was started, valleys have grown to be 55.000 worldwide. image With rendering, this number will increase quickly to cover more valleys.

  3. The tag is approved in the Openstreetmap wiki https://wiki.openstreetmap.org/wiki/Tag:natural%3Dvalley

Many beautiful renderings are shown here above, indicating that this is perfectly possible in an elegant way.