What steps will reproduce the problem?
1. >> e = shapefile.Editor(shapefile="shapefiles/test/polygon.shp")
2. >> print "No. of shapes: %i" % len(e.shapes())
3. >> e.delete(0)
4. >> print "No. of shapes: %i" % len(e.shapes())
What is the expected output? What do you see instead?
I expect the number of shapes to be reduced by one after the delete method is
called. Instead the number of shapes remains the same.
What version of the product are you using? On what operating system?
Using shapefile-1.1.6-b.py under Python 2.7 under linux (Fedora 14).
Please provide any additional information below.
The problem is caused by the way that the delete method determines whether
points, shapes, or parts are to be deleted. This logic fails because Python
evaluates 0 shape index as "False" when it applies the filtering logic. The
attached patch fixes the problem.
Original issue reported on code.google.com by jeffreyb...@gmail.com on 30 Dec 2012 at 1:45
Original issue reported on code.google.com by
jeffreyb...@gmail.com
on 30 Dec 2012 at 1:45Attachments: