id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 1486,Support Python object serialization (pickle) of OGRGeometry,jack.riley@…,hobu," [Originally posted to FWTools list February 2007, and Frank suggested that I submit as an enhancement request against GDAL] I have a Python (v2.3.5-based) application which stores OGR feature geometry objects (.GetGeometryRef().Clone()) in a dict. To support pickling of these OGRGeometry instances (w/o spatial reference system), I added the following __getstate__ and __setstate__ methods to the Geometry class in (my copy of) ogr.py: {{{ def __getstate__(self): return self.ExportToWkb() def __setstate__(self, state): result = CreateGeometryFromWkb(state) self._o = result._o self.thisown = result.thisown result.thisown = 0 }}} Note that a similar thing was done in Python Cartographic Library's geometry.py--see trac changeset 411: http://trac.gispython.org/projects/PCL/changeset/411 Frank's response to my posting of this on the FWTools list included the comment: ""I don't like that the spatial reference would not be captured though I can see that doing so would be quite hard."" Best regards, Jack",enhancement,closed,normal,,PythonBindings,unspecified,minor,fixed,,