From 4eb79003eea47ac3e1dae0202ee2a450b2eee0ed Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Mon, 9 Dec 2024 23:46:33 +0900 Subject: [PATCH] `open` all datasets at `zonal` entry point this should massively increase performance for `lazy=true` rasters. But it needs tests with rasters of every form. --- src/methods/zonal.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/methods/zonal.jl b/src/methods/zonal.jl index 1263a0acf..4c65dc6ec 100644 --- a/src/methods/zonal.jl +++ b/src/methods/zonal.jl @@ -72,7 +72,7 @@ insertcols!(january_stats, 1, :country => first.(split.(countries.ADMIN, r"[^A-Z 3 columns and 243 rows omitted ``` """ -zonal(f, x::RasterStackOrArray; of, kw...) = _zonal(f, x, of; kw...) +zonal(f, x::RasterStackOrArray; of, kw...) = open(x) do ox; _zonal(f, ox, of; kw...); end _zonal(f, x::RasterStackOrArray, of::RasterStackOrArray; kw...) = _zonal(f, x, Extents.extent(of); kw...)