Skip to content

Commit

Permalink
inverse distance weighting for point extraction from rasters
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-halverson committed Nov 7, 2024
1 parent 5bb095a commit 587b1cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rasters/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,8 @@ def IDW(self, geometry: VectorGeometry, power: float = 2) -> Union[float, gpd.Ge
# Calculate the interpolated value using weighted summation
result = np.nansum(weighted) / np.nansum(weight)

result = result.item()

# Return the result based on the input geometry type
if isinstance(geometry, SingleVectorGeometry):
return result
Expand Down

0 comments on commit 587b1cf

Please sign in to comment.