Closed abanduch closed 7 years ago
The problem here seems to be that you are using an older version of the library, but using the newest documentation. On GitHub, the master branch and README has been undergoing some radical changes, including renaming the _Shape class to Shape, and changing how the Writer.shape() method works, as in the documentation example you mentioned.
So if you update PyShp to the latest GitHub master branch, then your code should work. Alternatively, if you continue to use the older version, you can copy the shape object by changing w.shape(shaperec.shape)
to w._shapes.append(shaperec.shape)
.
One thing that might have added to the confusion is that the changed master branch continued to use the same version number as the previous release (1.2.11). For clarity and in the future, I have now updated the major version number and added "-dev" to indicate that it's a non-stable development version.
when trying to use the above code from the docs, i get the following error:
My goal here is to copy only a portion of an existing shapefile to a new one.