jxb5000
unread,Apr 17, 2012, 7:35:39 AM4/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Geospatial Python
Hello-
I am trying to use pyshp 1.1.4 Python library to read 3-D polygon
shapefiles (XYZ for each vertex).
This form of shapefile is described in "PolygonZ" section, p. 18, ESRI
Shapefile Technical Description, July 1998.
Everything is fine with 2-D shapefiles:
>>> shapes = shapefile.Reader("areas2d.shp").shapes()
(no errors here)
But with 3-D shapefile, this happens:
>>> shapes = shapefile.Reader("areas3d.shp").shapes()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/cygdrive/z/temp/pyshp-1.1.4/shapefile.py", line 310, in
shapes
shapes.append(self.__shape())
File "/cygdrive/z/temp/pyshp-1.1.4/shapefile.py", line 252, in
__shape
(mmin, mmax) = unpack("<2d", f.read(16))
File "/usr/lib/python2.5/struct.py", line 87, in unpack
return o.unpack(s)
struct.error: unpack requires a string argument of length 16
Environment details: Windows XP SP3, Python 2.5, 2-D and 3-D
shapefiles produced with GlobalMapper 12.
Thank you.