Pierre,

As Jon mentioned, the right way to handle this currently in Mapnik is to split 
out the multipolygons and label each. This is because the centroid algorithm 
that mapnik uses is not intended to work with multipolygons. Many Mapnik 
datasources do have an option to do this splitting called 
'multiple_geometries', which if passed, will handle parsing each geometry on 
its own. But the shapefile plugin does not support this option.

So if you intended to move your data to something like postgis, this will solve 
it. If you intended to keep it as a shapefile, using ogr2ogr to explode the 
features may be your best bet for now.

During testing I tried a few other centroid algorithms that work fine for 
multipolygons (http://trac.mapnik.org/changeset/2866), and we could consider 
making it an option to decide which is used.

Any thoughts?

Dane


On May 2, 2011, at 1:24 PM, Pierre Giraud wrote:

> Hello all,
> 
> I faced a weird behavior using mapnik2 and using the TextSymbolizer.
> The label for a specific feature is obviously misplaced.
> Attached is an archive with a simple xml map file, a shapefile with
> the guilty feature and a python script.
> Can someone please give it a try and tell me if I'm missing something ?
> 
> Thanks,
> Pierre
> 
> -- 
> Pierre GIRAUD
> Géomaticien, Analyste
> 
> Camptocamp France SAS
> Savoie Technolac, BP 352
> 73377 Le Bourget du Lac, Cedex
> 
> Tel : 00 33 4 79 44 44 93
> Mail : [email protected]
> http://www.camptocamp.com
> <england.tar.gz>_______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to