From a7b711945db97803907638e0bed1b77dc818329d Mon Sep 17 00:00:00 2001 From: cartwrightjc Date: Thu, 22 Aug 2024 15:47:38 +0000 Subject: [PATCH] op to predicate --- src/equi7grid/equi7grid.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/equi7grid/equi7grid.py b/src/equi7grid/equi7grid.py index c0b97e1..1101930 100644 --- a/src/equi7grid/equi7grid.py +++ b/src/equi7grid/equi7grid.py @@ -370,7 +370,7 @@ def lonlat2ij_in_tile(self, lon, lat, lowerleft=False): all_tile_names[sg_idx] = tile_names if given_in_scalar: return all_tile_names[0], int(i_ind[0]), int(j_ind[0]) - + i_ind = np.array([int(i) if i is not None else np.nan for i in i_ind]) j_ind = np.array([int(j) if j is not None else np.nan for j in j_ind]) @@ -397,7 +397,10 @@ def get_subgrids_spatial_join(self, lon, lat): ) # join the two geodatabases together. - join = gpd.sjoin(points, gdf, how="left", op="within") + try: + join = gpd.sjoin(points, gdf, how="left", predicate="within") + except TypeError: + join = gpd.sjoin(points, gdf, how="left", op="within") # remove rows with more than one hit indices = np.array(join.index)