From 587b1cf8e42e64a1c46fc7e0c30a81d3a7739e96 Mon Sep 17 00:00:00 2001 From: Gregory Halverson Date: Wed, 6 Nov 2024 22:06:29 -0800 Subject: [PATCH] inverse distance weighting for point extraction from rasters --- rasters/raster.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rasters/raster.py b/rasters/raster.py index 4b2f1f4..5975ab0 100644 --- a/rasters/raster.py +++ b/rasters/raster.py @@ -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