Skip to content

Commit

Permalink
Merge pull request #423 from martinfleis/geopandas-compat
Browse files Browse the repository at this point in the history
geopandas sjoin change compatibility
  • Loading branch information
SimonMolinsky authored Jun 26, 2024
2 parents b2209b7 + d83d088 commit 8902b84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyinterpolate/distance/gridding.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def points_to_grid(points: gpd.GeoDataFrame,
aggregated : geopandas GeoDataFrame
"""

joined = points.sjoin(grid, how='left', predicate='within')
joined = points.sjoin(grid.rename_axis("index_right"), how='left', predicate='within')
joined.drop('geometry', axis=1, inplace=True)
grouped = joined.groupby('index_right').mean()
aggregated = grid.join(grouped)
Expand Down
2 changes: 1 addition & 1 deletion pyinterpolate/processing/preprocessing/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def from_geodataframes(self,
point_support, blocks = self._transform_crs(point_support, blocks, use_point_support_crs)

# Merge data
joined = gpd.sjoin(point_support, blocks, how='left')
joined = gpd.sjoin(point_support, blocks.rename_axis("index_right"), how='left')

# Check which points weren't joined
if self.log_dropped:
Expand Down

0 comments on commit 8902b84

Please sign in to comment.