Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal shapelib: SBNOpenDiskTree(): make it work with node descriptors with non-increasing nBinStart #9439

Merged
merged 3 commits into from Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions autotest/ogr/ogr_shape_sbn.py
Expand Up @@ -142,3 +142,22 @@ def test_ogr_shape_sbn_2():
ds = ogr.Open("data/shp/CoHI_GCS12.shp")
lyr = ds.GetLayer(0)
return search_all_features(lyr)


###############################################################################
# Test bugfix for https://github.com/OSGeo/gdal/issues/9430


@pytest.mark.require_curl()
def test_ogr_shape_sbn_out_of_order_bin_start():

srv = "https://github.com/OSGeo/gdal-test-datasets/raw/master/shapefile/65sv5l285i_GLWD_level2/README.TXT"
if gdaltest.gdalurlopen(srv, timeout=5) is None:
pytest.skip(reason=f"{srv} is down")

ds = ogr.Open(
"/vsizip//vsicurl/https://github.com/OSGeo/gdal-test-datasets/raw/master/shapefile/65sv5l285i_GLWD_level2/65sv5l285i_GLWD_level2_sozip.zip"
)
lyr = ds.GetLayer(0)
lyr.SetSpatialFilterRect(5, 5, 6, 6)
assert lyr.GetFeatureCount() == 13