Opened 9 years ago

Closed 5 years ago

#3110 closed enhancement (wontfix)

[amenity-points] use type=label relations in mapnik

Reported by: Oli-Wan Owned by: mapnik-team@…
Priority: minor Milestone:
Component: mapnik Version:
Keywords: label, mapnik, relation, type=label Cc:

Description

Sometimes mapnik's placement algorithm for labels (names, icons, etc.) on areas (or buildings, etc.) is not quite optimal, especially for somewhat exotically-shaped areas.

osmarender allows for the type=label relation to specify the location the label should be placed. I believe this is a very good thing, so I suggest that the relation should be used by mapnik as well. (See http://wiki.openstreetmap.org/wiki/Relations/Proposed/Label for details about the type=label relation.)

This issue is loosely related to #1534 (area label positioning) http://trac.openstreetmap.org/ticket/1534 . But while #1534 concerns extending the placement algorithm itself to check for holes in multipolygons etc., here I suggest an explicit override to be specified in the map. I am not aware of any other way to specify such an override, but if it already exists (please give me a hint!), maybe the corresponding routine could be extended to check for type=label relations as well.

Change History (6)

comment:1 Changed 9 years ago by Tom Hughes

Ye gads no. A type=label relation is an abomination - it's a canonical example of "mapping for the renderer" and we don't do that in OpenStreetMap!

comment:2 Changed 9 years ago by Ldp

Also, different renderers would use different fonts and font size/styling, and so different placements could be needed for these different renderers. This could create a tug of war scenario with respect to label placement using this relation.

comment:3 in reply to:  2 Changed 9 years ago by Oli-Wan

Replying to Ldp:

Also, different renderers would use different fonts and font size/styling, and so different placements could be needed for these different renderers. This could create a tug of war scenario with respect to label placement using this relation.

The renderer could just read the relation as "imagine the area were a single node at the specified location" and then just do what it would in that case. I don't see wars coming up here. The label relation is not meant for "optimizing" label placement - it is intended only for a tiny fraction of cases where the default position chosen by several common renderers is complete garbage.

comment:4 in reply to:  1 Changed 9 years ago by Oli-Wan

Replying to TomH:

Ye gads no. A type=label relation is an abomination - it's a canonical example of "mapping for the renderer" and we don't do that in OpenStreetMap!

There's no rule without an exception.

Imagine a train station (mapped as a highly asymmetric area), where the actual platforms, along with all connections to roads, other public transit, shops, vending machines, etc. are all in one part of the area, far away from the center. One can argue that the train staion's label should then be placed in that part, and not at the default location (the area's center of mass, I guess).

There are probably more examples of such cases where labels are rendered at counter-intuitive positions, but I have seen only one, which is related to a somewhat strangely shaped station. But since those cases are so rare (most labels are displayed at sensible locations), there is no need to change the algorithms, but instead users should be given the option to override the default.

comment:5 Changed 5 years ago by math1985

Summary: use type=label relations in mapnik[amenity-points] use type=label relations in mapnik

comment:6 Changed 5 years ago by math1985

Resolution: wontfix
Status: newclosed

I will close this per TomH and Ldp.

Note: See TracTickets for help on using tickets.