﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
21003	BaseGeometryWidget is not idempotent	Mathieu Leplatre	nobody	"Currently, the geometry data is serialized as wkt :

https://github.com/django/django/blob/1.6b2/django/contrib/gis/forms/widgets.py#L69
https://github.com/django/django/blob/1.6b2/django/contrib/gis/templates/gis/openlayers.html#L20

And is read back here:

https://github.com/django/django/blob/1.6b2/django/contrib/gis/forms/fields.py#L95

But transform() will fail, because the instantiated Geometry won't have any projection associated (wkt does not carry srid).

```
GEOSException at ...
Calling transform() with no SRID set is not supported
```

https://github.com/django/django/blob/1.6b2/django/contrib/gis/forms/fields.py#L96


There are several possible solutions :

* Use EWKT instead of WKT
* Add srid=self.map_srid parameter to fromstr() when instantiating GEOSGeometry()
* Concatenate 'SRID=%s' % self.map_srid to the received data  (this is currently being done like this in JS in openlayers widget code https://github.com/django/django/blob/1.6b2/django/contrib/gis/static/gis/js/OLMapWidget.js#L263-L273)







"	Cleanup/optimization	closed	GIS	1.6-beta-1	Normal	fixed		Claude Paroz	Accepted	1	0	0	0	1	0
