gravitystorm / openstreetmap-carto

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

place=archipelago text is not displayed #3394

Open jdhoek opened 6 years ago

jdhoek commented 6 years ago

Expected behavior

See a label Isles of Scilly when looking at them.

Actual behavior

No label at any zoom-level. The name of the town Hugh Town is rendered loud and clearly.

Links and screenshots illustrating the problem

scilly-z12 scilly-z11 scilly-z9

jdhoek commented 6 years ago

Is this a bug in osm-carto, or does place=archipelago require a label-node?

kocio-pl commented 6 years ago

I don't see it anywhere in the code. Would you like to prepare the code?

https://taginfo.openstreetmap.org/tags/place=archipelago

taghistory 45

kocio-pl commented 6 years ago

However please note that for relations we probably need to resolve this issue first: https://github.com/openstreetmap/osm2pgsql/issues/230.

jdhoek commented 6 years ago

Ah… That is the same issue that is blocking rendering of place=quarter relations and such isn't it?

For those kind of relations the current tagging approach favoured seems to be adding a node with place=* (same as the relation) and name=*, and adding that as role=label to the relation. Would that be a suitable approach for this case?

kocio-pl commented 6 years ago

Ah… That is the same issue that is blocking rendering of place=quarter relations and such isn't it?

Yes, that's bigger problem with relations rendering.

Wen it comes to tagging I think you should ask at Tagging list.

pnorman commented 6 years ago

However please note that for relations we probably need to resolve this issue first: openstreetmap/osm2pgsql#230.

No, that issue has nothing to do with rendering what is an administrative relation.

matkoniecz commented 6 years ago

I will change the title to more general.

jeisenbe commented 5 years ago

It looks like some of these are mapped as multipolygon relations, but the wiki page also suggest mapping as a "type=cluster" relation, which is not very clearly defined.

We could render a name label for multipolygons, but our easy options are not great:

1) Render the name of the archipelago in the center of the largest island 2) Render the name of the archipelago at the center of every island 3) Render the name at the geometric center of the archipelago (probably in the ocean) 4) Render the name of the archipelago along the coastline of the islands

The first 3 options would just be a horizontal label, not aligned to the shape of the archipelago.

Ideally an archipelago would be have a nice curved text label that embraces the chain of islands from end-to-end at the right zoom level.

But to do something like this, we would need to preprocess the archipelago relations and create a new linear way from the overall extent of the islands. I think this would have to be done by a new script or external process? [EDIT: see below; this can actually be done in SQL, no preprocessing require]

@imagico, do you know of any tools that could help with this kind of rendering? There are already 740 archipelagos mapped, too many for hand-placed labels.

imagico commented 5 years ago

Use of place=archipelago on multipolygons is happening with fairly good consistency. There is some risk of this being abused for tagging descriptions or categories like islands of the Baltic Sea or Macaronesia. Like for place=island the risk of people drawing free form geometries is fairly low. There are a few cases of use of place=archipelago on closed ways for atolls which is not quite correct and should be filtered out for rendering (since an archipelago by definition would not be mappable with a single closed way).

The current documentation of place=archipelago does not provide any definition that limits its use to spatially cohesive groups of islands and therefore could be used to justify any abuse. This is something that i think would need to be fixed before it can be considered for rendering here.

That being said - the French style and the alternative-colors style both implement rendering of archipelagos based on convex hulls. What i use is essentially ST_ClosestPoint(way,ST_PointOnSurface(ST_ConvexHull(way))) plus some more elaborate logic to correctly treat archipelagos extending across the 180 degree meridian.

mboeringa commented 5 years ago

What i use is essentially ST_ClosestPoint(way,ST_PointOnSurface(ST_ConvexHull(way))) plus some more elaborate logic to correctly treat archipelagos extending across the 180 degree meridian.

I came to the same conclusion: usage of ST_ConvexHull(way) on the multipolygon relations of archipelagos gives decent results.