Skip to content

Commit

Permalink
added shapely make_valid to cascading_search
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Hayes committed Nov 13, 2024
1 parent fa66db4 commit ec9a5b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/coincident/search/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ec9a5b8

Please sign in to comment.