Skip to content

Commit

Permalink
Merge pull request #4 from nsat/cartwright/new-sjoin-key-word-params
Browse files Browse the repository at this point in the history
New sjoin key word parameters for shapely > 2.0.0
  • Loading branch information
cartwrightjc authored Aug 23, 2024
2 parents aae09dc + a7b7119 commit 0131bb7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/equi7grid/equi7grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand All @@ -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)
Expand Down

0 comments on commit 0131bb7

Please sign in to comment.