Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Nov 13, 2024
1 parent bcb345b commit 9d7c704
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/methods/zonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ _zonal(f, x::Raster, of::Extents.Extent; skipmissing=true) =
function _zonal(f, x::RasterStack, ext::Extents.Extent; skipmissing=true)
cropped = crop(x; to=ext, touches=true)
prod(size(cropped)) > 0 || return missing
return map(cropped) do A
return maplayers(cropped) do A
_maybe_skipmissing_call(f, A, skipmissing)
end
end
Expand All @@ -107,7 +107,7 @@ function _zonal(f, st::AbstractRasterStack, ::GI.AbstractGeometryTrait, geom;
skipmissing=true, kw...
)
cropped = crop(st; to=geom, touches=true)
prod(size(cropped)) > 0 || return map(_ -> missing, st)
prod(size(cropped)) > 0 || return map(_ -> missing, layerdims(st))
masked = mask(cropped; with=geom, kw...)
return maplayers(masked) do A
prod(size(A)) > 0 || return missing
Expand Down

0 comments on commit 9d7c704

Please sign in to comment.