Skip to content

Commit

Permalink
feat(masking vectors of layers with polygons with joint mask across l…
Browse files Browse the repository at this point in the history
…ayers)
  • Loading branch information
gottacatchenall committed Dec 16, 2024
1 parent 01445f8 commit 7ce7bb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/polygons/polygons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ce7bb5

Please sign in to comment.