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]