yourcelf / olwidget

Javascript library to replace textareas that contain WKT data with editable OpenLayers maps, and a django app using it for django forms and admin.
Other
91 stars 43 forks source link

Large multipolygon that can be viewed, edited, but not saved after editing #63

Open slinkp opened 13 years ago

slinkp commented 13 years ago

I haven't firebugg'd through the olwidget code on this yet, but if I have a Django object with a GeometryField that contains this multipolygon: https://gist.github.com/1002741 ... then if I load the object up in django-admin with a GeoModelAdmin UI, I can save if I don't change anything.

But if I try to edit the geometry by eg. deleting a few points, and I click save, I can see that the POST request does not contain the geometry at all and django throws a validation error. So it seems to be a client-side problem of some kind.

(fwiw, the multipolygon was generated by taking the union of a bunch of zip codes, and subtracting the union of a bunch of neighborhoods - so it's basically "everything inside a boston zip code that isn't in a known neighborhood", and it has a lot of little crufty bits scattered around that are probably just noise from not-quite-overlapping neighborhood bounds.)

yourcelf commented 13 years ago

Indeed; I can reproduce that -- viewing, editing fine; saving not. GEOS is throwing:

GEOS_ERROR: IllegalArgumentException: Invalid number of points in LinearRing found 3 - must be 0 or >= 4

Did you get any progress on figuring out why?

slinkp commented 12 years ago

nope, sorry, no ideas.