From 1bfc63143fe6d5cb2b47ebacb7117e94ae963fa9 Mon Sep 17 00:00:00 2001 From: Gregory Halverson Date: Tue, 5 Nov 2024 15:10:42 -0800 Subject: [PATCH] working on point extraction --- rasters/raster.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rasters/raster.py b/rasters/raster.py index 4bc1670..62138ae 100644 --- a/rasters/raster.py +++ b/rasters/raster.py @@ -970,6 +970,9 @@ def geolocation(self) -> Raster: return self.contain(geometry=self.geometry.geolocation) def to_point(self, point: Point): + if not self.geometry.intersects(point): + return np.nan + index = self.geometry.index_point(point) value = self.array[index]