|
2 | 2 |
|
3 | 3 | import geopandas |
4 | 4 | import numpy as np |
5 | | -from packaging.version import Version |
6 | 5 | from shapely import geometry |
7 | 6 |
|
8 | 7 | from ...examples import get_path |
9 | 8 | from ..alpha_shapes import alpha_shape, alpha_shape_auto |
10 | 9 |
|
11 | | -GPD_013 = Version(geopandas.__version__) >= Version("0.13") |
12 | | - |
13 | 10 | this_directory = os.path.dirname(__file__) |
14 | 11 |
|
15 | 12 |
|
@@ -105,19 +102,12 @@ def test_holes(self): |
105 | 102 | holes = geopandas.GeoSeries(geoms.interiors.explode()).reset_index(drop=True) |
106 | 103 | assert len(holes) == 30 |
107 | 104 | # No holes are within the shape (shape has holes already) |
108 | | - if GPD_013: |
109 | | - result = geoms.sindex.query(holes.centroid, predicate="within") |
110 | | - else: |
111 | | - result = geoms.sindex.query_bulk(holes.centroid, predicate="within") |
| 105 | + result = geoms.sindex.query(holes.centroid, predicate="within") |
112 | 106 |
|
113 | 107 | assert result.shape == (2, 0) |
114 | 108 | # All holes are within the exterior |
115 | 109 | shell = geopandas.GeoSeries(geoms.exterior.apply(geometry.Polygon)) |
116 | | - if GPD_013: |
117 | | - within, outside = shell.sindex.query(holes.centroid, predicate="within") |
118 | | - else: |
119 | | - within, outside = shell.sindex.query_bulk( |
120 | | - holes.centroid, predicate="within" |
121 | | - ) |
| 110 | + within, outside = shell.sindex.query(holes.centroid, predicate="within") |
| 111 | + |
122 | 112 | assert (outside == 0).all() |
123 | 113 | np.testing.assert_array_equal(within, np.arange(30)) |
0 commit comments