[Community] Shapely multipolygon bug

Eric Lemoine eric.c2c at gmail.com
Sat Oct 13 00:37:25 EEST 2007


Note that I've created a ticket for this stuff.
<http://trac.gispython.org/projects/PCL/ticket/124>

On 10/12/07, Eric Lemoine <eric.c2c at gmail.com> wrote:
> Hello
>
> I think I found a bug in Shapely's multipolygon.
>
> Today's code gives me this:
>
> {'type': 'MultiPolygon', 'coordinates': [(((26.964956283569336,
> -23.751949310302734), ... , (26.964956283569336,
> -23.751949310302734)), [((28.801544189453125, -28.700178146362308),
> ... , (28.801544189453125, -28.700178146362308))])]}
>
> (note: the above multipolygon is actually a single polygon with one hole)
>
> I think this isn't correct. The hole polygon shouldn't be contained in a list.
>
> We should get this instead:
>
> {'type': 'MultiPolygon', 'coordinates': [[((26.964956283569336,
> -23.751949310302734), ... , (26.964956283569336,
> -23.751949310302734)), ((28.801544189453125, -28.700178146362308), ...
> , (28.801544189453125, -28.700178146362308))]]}
>
> Attached is a patch that corrects that. I checked using OpenLayers
> GeoJSON, and OpenLayers prefers the GeoJSON resulting from the new
> object structure, and I think it is right :-)
>
> --
> Eric
>
>



More information about the Community mailing list