django - GeoDjango Polygon Field ParseException -
i using geodjango display form user can select area on map , name it.
i have following model
import django.contrib.gis.db.models models class area(models.model): name = models.charfield(max_length=25) area_target = models.polygonfield(default='polygon empty')
and form
from django.contrib.gis import forms class areaform(forms.form): name = forms.charfield(max_length=160) area_target = forms.polygonfield(srid=4326, required=false, widget=forms.osmwidget(attrs={'map_width': 600, 'map_height': 500}))
the form displayed correctly , can select area using map widget, following error message when submit form:
geos_error: parseexception: expected 'z', 'm', 'zm', 'empty' or '(' encountered : ')'
geos_error: parseexception: expected 'z', 'm', 'zm', 'empty' or '(' encountered : ')'
error creating geometry value 'srid=900913;polygon()' (error encountered checking geometry returned geos c function "geoswktreader_read_r".)
as can see in debug output there no values edges of polygon.
i using django 1.9.4, postgres 9.5.1.0 db postgis extension , geos 3.5 geometry backend.
can tell me what's wrong?
polygon(())
invalid wkt, , throw parseexception shown.
try polygon empty
create empty polygon geometry.
i'm not familiar geodjango, perhaps null/none option too.
Comments
Post a Comment