[Community] shapely and pickle - loses dimension

Redoute redoute at tortenboxer.de
Fri Mar 2 22:20:16 EET 2012


Hi all,

I'm not sure if this is a bug or if it simply can't work:

[Code]
from shapely.geometry import LineString
from cPickle import dumps, loads, HIGHEST_PROTOCOL

l = LineString(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0)))
print l
print l._ndim # result: 2

s = dumps(l, HIGHEST_PROTOCOL)
print s

l = loads(s)
print l
print l._ndim # result: None
[/Code]

Which results in strange errors in following computations:

>   File "C:\Programme\Python27\lib\site-packages\shapely-1.2.14-py2.7-win32.egg\s
> hapely\coords.py", line 113, in ctypes
>     array_type = c_double * (m * n)
> TypeError: unsupported operand type(s) for *: 'long' and 'NoneType'

Redoute


More information about the Community mailing list