Hello, first post here. I am learning about python and shapefiles. Running on a Windows 7 computer.
Following the pyshp example I tried to create a shapefile for a polygon and got an error after the w.save ...
>>> import shapefile
>>> w = shapefile.Writer(shapefile.POLYGON)
>>> test='[[[5774289,3820335][5774289,3820335][5774649,3820268][5774709,3819882][5774689,3819640][5774599,3819368][5774399,3819538][5774219,3819779][5774109,3819990][5774039,3820175]]]'
>>> w.poly(parts=test)
>>> w.field('FIRST_FLD','C','40')
>>> w.field('SECOND_FLD','C','40')
>>> w.record('First','Polygon')
>>> w.save('c:\\Python27\\polygon')
Traceback (most recent call last):
File "<pyshell#31>", line 1, in <module>
w.save('c:\\Python27\\polygon')
File "C:/Python27\shapefile.py", line 1028, in save
self.saveShp(target)
File "C:/Python27\shapefile.py", line 985, in saveShp
self.__shapefileHeader(self.shp, headerType='shp')
File "C:/Python27\shapefile.py", line 709, in __shapefileHeader
raise ShapefileException("Failed to write shapefile bounding box. Floats required.")
ShapefileException: Failed to write shapefile bounding box. Floats required.
Not sure what to do. Suggestions appreciated.
Bill
--
You received this message because you are subscribed to the Google Groups "Geospatial Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geospatialpyth...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.