-
-
Notifications
You must be signed in to change notification settings - Fork 259
Closed
Labels
Description
PyShp Version
2.3.1
Python Version
3.11
Your code
import shapefile
fname = "dataverse_files/v6_1820_pref_pts_gbk.shp"
bbox = [19166000, 3461000, 20297000, 3596000]
sf = shapefile.Reader(fname, encoding='gbk')
print(len(list(sf.iterShapeRecords(bbox=bbox))))
Expected results
10
Actual results
301
Other notes
As part of a PR over at cartopy (SciTools/cartopy#2236) I was comparing the output from bounding box spatial filtering with PyShp and fiona for several shapefiles and found some differences. For this shapefile (which just contains Points), PyShp does not seem to filter at all. I think this is a bug? The data used is at https://dataverse.harvard.edu/file.xhtml?persistentId=doi:10.7910/DVN/2K4FHX/V0WEFJ&version=1.0