Open andyclegg opened 9 years ago
Another idea, taking advantage of iDs ability to draw labels along arbitrary paths. Break the area down into a polygon mesh of triangles. Find the centroid of each triangle. Draw the label along the imaginary path which connects these centroids.
update: try @mourner's https://github.com/mapbox/polylabel
https://github.com/mapbox/polylabel's PIA would work well.
For example, see http://www.openstreetmap.org/edit?editor=id&way=23543197#map=18/57.17726/-2.14126 The label for 'River Don' appears on top of the northernmost soccer field. I am presuming this is because it is the centroid of the nearby riverbank area, however because the area is not convex, it does not necessarily enclose its own centroid. The simplest solution would probably be to test the calculated label point, and if it is not enclosed by the area, do not display it. ]