zhikrullah / pyshp

Automatically exported from code.google.com/p/pyshp
MIT License
0 stars 0 forks source link

Cannot save POINTZ file #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
With Shapefile r28 (for Python2.x), I cannot seem to write a simple 3D 
Shapefile:

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import shapefile
>>> sf = shapefile.Writer(shapefile.POINTZ)
>>> sf.field('RecID')
>>> sf.point(100.0, 200.0, 300.0)
>>> sf.record(1)
>>> sf.save('foo.shp')
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "I:\somepath\shapefile.py", line 765, in save
    self.saveShp(target)
  File "I:\somepath\shapefile.py", line 738, in saveShp
    self.__shapefileHeader(self.shp, headerType='shp')
  File "I:\somepath\shapefile.py", line 486, in __shapefileHeader
    f.write(pack(">i", self.__shpFileLength()))
  File "I:\somepath\shapefile.py", line 372, in __shpFileLength
    nParts = len(s.parts)
AttributeError: _Shape instance has no attribute 'parts'

Original issue reported on code.google.com by mwto...@gmail.com on 21 Apr 2011 at 5:02

GoogleCodeExporter commented 8 years ago
I will look into this. My guess is my fix to read in POINTZ files was not 
complete. I never tested writing POINTZ type shapefiles.

Original comment by ledere...@gmail.com on 27 Apr 2011 at 1:44

GoogleCodeExporter commented 8 years ago
That was fun and took a while. Perhaps at a later date we can have a discussion 
about internal data structures...

Original comment by ledere...@gmail.com on 27 Apr 2011 at 7:42