Discussion:
[Community] shapely and pickle - loses dimension
Redoute
2012-03-02 20:20:16 UTC
Permalink
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]
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
Sean Gillies
2012-03-02 21:15:51 UTC
Permalink
Looks like a bug. Will you do me the favor of creating an issue at
https://github.com/Toblerity/Shapely? I'll take a look at it soon.
Post by Redoute
Hi all,
[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]
? 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
_______________________________________________
Community mailing list
Community at lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community
--
Sean Gillies
Redoute
2012-03-02 21:44:11 UTC
Permalink
Post by Sean Gillies
Looks like a bug. Will you do me the favor of creating an issue at
https://github.com/Toblerity/Shapely? I'll take a look at it soon.
Thank you for your support!

Redoute

Loading...