From 7ce7bb56fe8cddffabdd4b8070bea801936f05bc Mon Sep 17 00:00:00 2001 From: "michael d. catchen" Date: Mon, 16 Dec 2024 10:45:46 -0500 Subject: [PATCH] feat(masking vectors of layers with polygons with joint mask across layers) --- src/polygons/polygons.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/polygons/polygons.jl b/src/polygons/polygons.jl index 6077a2423..60050a47d 100644 --- a/src/polygons/polygons.jl +++ b/src/polygons/polygons.jl @@ -78,7 +78,7 @@ function _get_inclusion_from_polygon!(inclusion, layer, multipolygon::GeoJSON.Mu end function SimpleSDMLayers.mask!(layers::Vector{SDMLayer}, multipolygon::GeoJSON.MultiPolygon) - inclusion = zeros(eltype(first(layers).indices), size(first(layers))) + inclusion = .!reduce(.|, [l.indices for l in layers]) _get_inclusion_from_polygon!(inclusion, first(layers), multipolygon) for layer in layers layer.indices .&= inclusion