gravitystorm / openstreetmap-carto

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

Labels of National park boundaries (and others protected areas) #3569

Open sig-pnrnm opened 5 years ago

sig-pnrnm commented 5 years ago

The different protected areas should soon be much more rendered (see here, and test prototype here). This is very good news for me who has been waiting for this for a long time. However, because their labels are visible from the zoom 8, the map tends to be covered with green text (this is for example the case in France with the Regional Nature Parks). zoom_8

If it were possible, it would be interesting for the labels to be visible only from the zoom 9, and at the zoom 8, only the perimeters are visible.

sig-pnrnm commented 5 years ago

It would also be relevant to use tag short_name when it exists.

jeisenbe commented 5 years ago

What protect_class are these Regional Nature Park areas in France?

If they are less significant than national parks, perhaps the whole class should be rendered one zoom level later.

kocio-pl commented 5 years ago

We could not found any rule regarding "importance" of protected areas, so we use size, which works quite good.

Tomasz-W commented 5 years ago

I don't have a problem with these labels on z8 and I don't see them as something creating a mess there.

sig-pnrnm commented 5 years ago

What protect_class are these Regional Nature Park areas in France?

They are protect_class=5

If they are less significant than national parks, perhaps the whole class should be rendered one zoom level later.

The protection is less strong, indeed. But the tourist interest is not less. I do not think that it is necessary to complicate things by looking for a specific rendering for each class of protected area (currently, it is already complicated to manage all these zones). But by only displaying the texts at a higher zoom level, that would be enough for the national parks too.

I don't have a problem with these labels on z8 and I don't see them as something creating a mess there.

I do not think it creates a mess there, but I find that these labels are displayed while other important cartographic landmarks are not.

kocio-pl commented 5 years ago

But by only displaying the texts at a higher zoom level, that would be enough for the national parks too.

We also show military areas on z8+, so this is more complex problem. Could you make some test renderings to check how would it look like?

matkoniecz commented 5 years ago

For me it looks like a tagging issue. Is it really the common name for this areas? From style and length it looks like something that should be in the official_name and in name tag should be something that is actually typically used.

sig-pnrnm commented 5 years ago

Is it really the common name for this areas?

Yes it is ! But in France, we commonly says 'PNR xxx', not 'Parc naturel régional xxx'. That's why we tag the short_name too. Putting 'PNR xxx' in the name and 'Parc naturel régional xxx' in the official_name does not seem to me quite correct

kocio-pl commented 5 years ago

Putting 'PNR xxx' in the name and 'Parc naturel régional xxx' in the official_name does not seem to me quite correct

Why not? name=* tag is exactly about common names, and if common name is the same as short name, just fill both tags with the same value.

matkoniecz commented 5 years ago

Thanks for spotting this issue!

For now I opened https://www.openstreetmap.org/note/1619006 as it seems that problem is in data, not in styling of data.

jragusa commented 5 years ago

Is it really the common name for this areas?

Yes it is ! But in France, we commonly says 'PNR xxx', not 'Parc naturel régional xxx'. That's why we tag the short_name too. Putting 'PNR xxx' in the name and 'Parc naturel régional xxx' in the official_name does not seem to me quite correct

On Geoportail (french topographic website), "Parc naturel régional" are frequently written entirely, they do not use PNR unless space is limited. Example with the Parc naturel régional Normandie-Maine or with the Parc naturel régional du Massif des Beauges (slightly shorten).

I agree with @matkoniecz, it's more a tagging issue. I would tend to propose 'PNR xxx' in the name and 'Parc naturel régional xxx' in the official_name if it's really necessary. But honestly, I never heard someone using the term "PNR" to describe this feature, they all used the complete name. I guess it's more used in administration than in the general public.

vholten commented 5 years ago

On the Geoportail website, when zooming out, they use "Parc xxx" instead of "Parc naturel régional xxx". This appears to be a common way to refer to these parks. Examples:

jeisenbe commented 5 years ago

Is there any support in Mapnik for rendering different names based on the size of the polygon? I suspect not?

It would be nice if we could show the short_name when the full name is too long. On Mon, Dec 17, 2018 at 9:50 PM vholten notifications@github.com wrote:

On the Geoportail website, when zooming out, they use "Parc xxx" instead of "Parc naturel régional xxx". This appears to be a common way to refer to these parks. Examples:

-

"Parc naturel régional du Massif des Bauges" -> "Parc du Massif des Bauges" The shorter name is also used on their website, for example here http://www.parcdesbauges.com/fr/actualite/marteloscope-biodiversite-de-faverges-vive-le-martelage-numerique-246.html: "A l’initiative du Parc du Massif des Bauges..."

"Parc naturel régional des volcans d'Auvergne" -> "Parc des volcans d'Auvergne" The shorter name is already used in the first sentence of the Wikipedia article https://fr.wikipedia.org/wiki/Parc_naturel_r%C3%A9gional_des_volcans_d%27Auvergne and also on the official site http://www.parcdesvolcans.fr/Vivre-ici/Pres-de-chez-vous/Actualites/Le-sentier-GR400-du-Puy-Mary-remis-en-etat .

"Parc naturel régional Normandie-Maine" -> "Parc Normandie-Maine" The shorter name is also used in the Wikipedia article https://fr.wikipedia.org/wiki/Parc_naturel_r%C3%A9gional_Normandie-Maine: "Le territoire du Parc Normandie-Maine s’articule..." and on the official site http://www.parc-naturel-normandie-maine.fr/actualites/voyage-d-etude-dans-le-geoparc-des-bauges_347.html "Dans le cadre de la candidature du Parc Normandie-Maine..."

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/gravitystorm/openstreetmap-carto/issues/3569#issuecomment-447834942, or mute the thread https://github.com/notifications/unsubscribe-auth/AoxshGyjXx4x3RGvHsIIDUUleVgqIQfwks5u55MNgaJpZM4ZTNSZ .

dieterdreist commented 5 years ago

sent from a phone

On 17. Dec 2018, at 14:00, jeisenbe notifications@github.com wrote:

Is there any support in Mapnik for rendering different names based on the size of the polygon? I suspect not?

this should be doable with the database query.

kocio-pl commented 5 years ago

Mapnik algorithm is very simplistic - it just finds a centroid node for placing labels. It should start with constructing label and checking the shape of the rectangle, and then try to fit this box into the shape.

In OSM Carto we just use our limits, which works pretty good:

https://github.com/gravitystorm/openstreetmap-carto/blob/295d65d7623c6a323d83bb254cefadeeb8e4c10c/admin.mss#L223-L224

so we could add less strict limit for short names (for example for way_pixels > 2000).

sig-pnrnm commented 5 years ago

It would be nice if we could show the short_name when the full name is too long.

That's exactly what I would have hoped for!

On the Geoportail website, when zooming out, they use "Parc xxx" instead of "Parc naturel régional xxx". This appears to be a common way to refer to these parks

Agree with this ! I just made the change for the French parks

kocio-pl commented 5 years ago

Do I understand it right that the issue is solved by using different name=* tagging? If yes please close this ticket.

sig-pnrnm commented 5 years ago

Do I understand it right that the issue is solved by using different name=* tagging?

Using short_name when the name is too long will indeed improve the readability of the map. But, if I'm not mistaken, it's not yet operational?

From my point of view, the name could be displayed only at 9 zoom, but I hear that everyone is not of this opinion. No problem to close this issue :wink:

kocio-pl commented 5 years ago

Well, we probably might check the length of the name string and in case it's too long, we could try short_name, but we have no such example in our SQL and I'm not sure how to make rendering names consistent.

After all our simple rule works quite good - the names are largely kept inside the area, so it looks sane for me.

Bibi56 commented 5 years ago

Putting 'PNR xxx' in the name and 'Parc naturel régional xxx' in the official_name does not seem to me quite correct

Why not? name=* tag is exactly about common names, and if common name is the same as short name, just fill both tags with the same value.

We read "Parc Naturel Régional" but write PNR on a map so it's really the short_name, on signs you'll see Parc Naturel Régional. Parc XXX as already mentioned is a better way to shorten (more general public use). So removing "Naturel Régional " if the name is too long - same logic as the one used for shortening road names I believe.

jeisenbe commented 4 years ago

Has anyone else noticed this problem in other areas at z9, or does this seem to not be an issue anymore?

It would add a fair amount of code complexity if we were to check for short_name for every similar feature.

Bibi56 commented 4 years ago

Names are pretty long in several countries, below some examples in Europe (UK, PL, DE, RU, FR, IT, SP). You mentioned z9, so I checked at z9 but we have already the issue as level z8 (where it's of course worse). https://www.openstreetmap.org/#map=9/50.4995/-1.9336 https://www.openstreetmap.org/#map=9/51.5754/11.0632 https://www.openstreetmap.org/#map=9/51.4403/15.1968 https://www.openstreetmap.org/#map=9/54.0223/23.5437 https://www.openstreetmap.org/#map=9/53.6756/29.9982 https://www.openstreetmap.org/#map=9/55.0343/37.1585 https://www.openstreetmap.org/#map=9/54.7817/41.3580 https://www.openstreetmap.org/#map=9/44.0086/39.8007 https://www.openstreetmap.org/#map=9/45.2575/36.7520 https://www.openstreetmap.org/#map=9/45.1045/12.4997 https://www.openstreetmap.org/#map=9/44.2511/11.2088 https://www.openstreetmap.org/#map=9/37.8380/-3.5953 https://www.openstreetmap.org/#map=9/39.3194/-9.0829 https://www.openstreetmap.org/#map=9/43.3671/-6.7731

Bibi56 commented 4 years ago

It would add a fair amount of code complexity if we were to check for short_name for every similar feature.

Really? That's what OSM-FR does by default for some features. 2 ways:

The long version is displayed, if it can't the short version is tried, see the example on hospitals.

jeisenbe commented 4 years ago

The best way to find out if such a change would be acceptable would be to submit a Pull Request with the recommended changes so that the specific code changes can be discussed.

jeisenbe commented 4 years ago

@meased - would you be interested at trying to solve this next, since you were working on improving protected natural areas rendering?

Now that I've reviewed your PR #3887 it has been visible that the current protected area labels are rather strong on z8 and z9.

An easy solution might be changing this from 3000 at all levels to 12,000 at z8 and z9, and 3000 way_pixels at z10 and above, in amenity-points.mss:

Current:

  [feature = 'leisure_nature_reserve'],
  [feature = 'boundary_aboriginal_lands'],
  [feature = 'boundary_protected_area'] {
    [zoom >= 8][way_pixels > 3000][way_pixels <= 768000][is_building = 'no'],
    [zoom >= 17][way_pixels <= 768000] {

After:

  [feature = 'leisure_nature_reserve'],
  [feature = 'boundary_aboriginal_lands'],
  [feature = 'boundary_protected_area'] {
    [zoom >= 8][way_pixels > 12000][way_pixels <= 768000][is_building = 'no'],
    [zoom >= 10][way_pixels > 3000][way_pixels <= 768000][is_building = 'no'],
    [zoom >= 17][way_pixels <= 768000] {

We could also check how this looks for military areas, glaciers, sand, bare_rock, forests, and the few other features which are rendered at z8 and z9.

This would have the affect of showing the labels one zoom level later and on areas that are twice as wide and tall as the current minimum size.

jeisenbe commented 4 years ago

I'm planning to change the protect_class=5/6 areas to only render from z9.

Also, I would like to only render the names for these areas at >12k way_pixels (when the feature takes up at least 12,000 square pixels at standard resolution) at z9 and z10, instead of the current limit of 3k way_pixels - that's one zoom level later.

I believe implementing both of those options will resolve this issue.