On Wed, Jul 27, 2011 at 8:49 AM, Alex Morega <[email protected]> wrote: > I'm rendering a simple map with country borders and labels, and have come up > against a problem with placing labels: they are always placed at the > polygon's center, even if that center is not within the polygon itself. For > example, in [1], the label for Croatia. By contrast, Mapnik tiles for > OpenStreetMap[2] seem to have much better placement. What is going on?
OpenStreetMap uses separate points for country labels, not polygons. They are placed manually in the approximate visual centre of the region. This is what I recommend doing for labels - you can derive a shapefile of centroid points in something like QGIS and tweak the placement of points that aren't quite right. There is a quick solution for just the polygons, however. Add a `placement="interior"` parameter to your TextSymbolizer and the label should always appear within the polygon. (This is only available in Mapnik trunk.) -- AJ Ashton _______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

