|
27 | 27 | "get_network_ratio", |
28 | 28 | ] |
29 | 29 |
|
30 | | -GPD_GE_013 = Version(gpd.__version__) >= Version("0.13.0") |
31 | 30 | GPD_GE_10 = Version(gpd.__version__) >= Version("1.0dev") |
32 | 31 |
|
33 | 32 |
|
@@ -443,14 +442,7 @@ def _enclosed_tessellation( |
443 | 442 | enclosures["position"] = range(len(enclosures)) |
444 | 443 |
|
445 | 444 | # determine which polygons should be split |
446 | | - if GPD_GE_013: |
447 | | - inp, res = buildings.sindex.query( |
448 | | - enclosures.geometry, predicate="intersects" |
449 | | - ) |
450 | | - else: |
451 | | - inp, res = buildings.sindex.query_bulk( |
452 | | - enclosures.geometry, predicate="intersects" |
453 | | - ) |
| 445 | + inp, res = buildings.sindex.query(enclosures.geometry, predicate="intersects") |
454 | 446 | unique, counts = np.unique(inp, return_counts=True) |
455 | 447 | splits = unique[counts > 1] |
456 | 448 | single = unique[counts == 1] |
@@ -1003,14 +995,7 @@ def enclosures( |
1003 | 995 | ) |
1004 | 996 | additional = pd.concat([gdf.geometry for gdf in additional_barriers]) |
1005 | 997 |
|
1006 | | - if GPD_GE_013: |
1007 | | - inp, res = enclosures.sindex.query( |
1008 | | - additional.geometry, predicate="intersects" |
1009 | | - ) |
1010 | | - else: |
1011 | | - inp, res = enclosures.sindex.query_bulk( |
1012 | | - additional.geometry, predicate="intersects" |
1013 | | - ) |
| 998 | + inp, res = enclosures.sindex.query(additional.geometry, predicate="intersects") |
1014 | 999 | unique = np.unique(res) |
1015 | 1000 |
|
1016 | 1001 | new = [] |
@@ -1053,14 +1038,9 @@ def enclosures( |
1053 | 1038 | "`limit` requires a GeoDataFrame or GeoSeries with Polygon or " |
1054 | 1039 | "MultiPolygon geometry to be used with `clip=True`." |
1055 | 1040 | ) |
1056 | | - if GPD_GE_013: |
1057 | | - _, encl_index = final_enclosures.representative_point().sindex.query( |
1058 | | - limit.geometry, predicate="contains" |
1059 | | - ) |
1060 | | - else: |
1061 | | - _, encl_index = final_enclosures.representative_point().sindex.query_bulk( |
1062 | | - limit.geometry, predicate="contains" |
1063 | | - ) |
| 1041 | + _, encl_index = final_enclosures.representative_point().sindex.query( |
| 1042 | + limit.geometry, predicate="contains" |
| 1043 | + ) |
1064 | 1044 | keep = np.unique(encl_index) |
1065 | 1045 | return final_enclosures.iloc[keep] |
1066 | 1046 |
|
|
0 commit comments