Skip to content

Commit

Permalink
fixes #1128
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Apr 25, 2023
1 parent ffb53ec commit 85ee3c9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/raster_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3140,12 +3140,7 @@ SpatRaster SpatRaster::cropmask(SpatVector &v, std::string snap, bool touches, b
out.setError("cannot crop a SpatRaster with an empty SpatVector");
return out;
}
if (hasValues() && (!opt.datatype_set)) {
std::vector<std::string> dt = getDataType(true);
if ((dt.size() == 1) && !dt[0].empty()) {
opt.set_datatype(dt[0]);
}
}

SpatOptions copt(opt);
SpatRaster out = crop(v.extent, snap, extend, copt);
return out.mask(v, false, NAN, touches, opt);
Expand Down

0 comments on commit 85ee3c9

Please sign in to comment.