From ec9a5b8766ba67ff8213eafd4be612085ac89d10 Mon Sep 17 00:00:00 2001 From: Jack-Hayes Date: Wed, 13 Nov 2024 11:43:00 -0800 Subject: [PATCH] added shapely make_valid to cascading_search --- src/coincident/search/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/coincident/search/main.py b/src/coincident/search/main.py index 9669812..f4be7be 100644 --- a/src/coincident/search/main.py +++ b/src/coincident/search/main.py @@ -4,6 +4,7 @@ from typing import Any import geopandas as gpd +from shapely.validation import make_valid # Used to access formatters from pystac_client.item_search import ItemSearch as _ItemSearch @@ -249,7 +250,8 @@ def cascading_search( A list of GeoDataFrames containing the search results for each secondary dataset. """ # Do searches on simple geometry, but intersect results with original geometry - search_geometry = primary_dataset.simplify(0.01) # or convex_hull? + search_geometry = primary_dataset.simplify(0.01).apply(make_valid) + #search_geometry = primary_dataset.geometry.apply(lambda geom: make_valid(geom.simplify(0.01))) detailed_geometry = primary_dataset[["geometry"]] if "end_datetime" in primary_dataset.columns: