Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Jan 23, 2025
1 parent f50c737 commit 5129213
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Released 2024-12-12
- `vect<SpatGraticule>` method suggested in relation to [tidyterra #155](https://github.com/dieghernan/tidyterra/issues/155) by Diego Hernangómez
- `toMemory<SpatRaster>` and `<SpatRasterDataset>` methods [#1660](https://github.com/rspatial/terra/pull/1660) by Derek Friend


# version 1.7-83

Released 2024-10-14
Expand Down
9 changes: 8 additions & 1 deletion src/raster_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3543,7 +3543,14 @@ SpatRaster SpatRaster::cropmask(SpatVector &v, std::string snap, bool touches, b
return out;
}
std::vector<bool> w = hasWindow();
if (extend || vany(w, true)) {
bool haswin = false;
for (size_t i=0; i<w.size(); i++) {
if (w[i]) {
haswin = true;
break;
}
}
if (extend || haswin) {
SpatOptions copt(opt);
out = crop(v.extent, snap, extend, copt);
if (out.hasError()) return out;
Expand Down

0 comments on commit 5129213

Please sign in to comment.