Ticket #124 (defect)
Opened 1 year ago
Last modified 1 year ago
Shapely multipolygon bug
Status: closed (fixed)
| Reported by: | elem | Assigned to: | seang |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | Shapely | Version: | |
| Keywords: | Cc: | ||
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
Attachments
Change History
10/12/07 15:36:48: Modified by elem
- attachment patch-shapely-multipolygon-A0.diff added.
10/13/07 08:30:11: Modified by seang
- status changed from new to closed.
- resolution set to fixed.
You are correct, Eric. Fixed in r902. Thanks for the patch.

patch