artemp/trac2github — Issue #813: Labeling algorithms that support multi-geometries
Author: artemp
Created: 2011-10-09 20:52:02+00:00
State: open
Labels: Core_Library

Currently the centroid algorithm used by geometry::label_position does work for multipolygons. This was reported with a test case at https://lists.berlios.de/pipermail/mapnik-users/2011-May/004213.html.

The workaround is to set 'multiple_geometries' if using postgis so that multi* are flattened when read. ***But not all datasources support this option.***

So, ideally all placement algorithms would provide valid results for each geometry type and user control could be exposed over whether the averaged centroid is used or whether labels are placed for each geometry part.

As reference, alternative (currently unused) centroid approaches were added in http://trac.mapnik.org/changeset/2866 that do not suffer from the multigeom problem in the same way.