Skip to content

Commit

Permalink
for #1648
Browse files Browse the repository at this point in the history
  • Loading branch information
rhijmans committed Dec 19, 2024
1 parent 0af5eab commit f6f5554
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions man/terraOptions.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ The following options are available.
\bold{progress} - non-negative integer. A progress bar is shown if the number of chunks in which the data is processed is larger than this number. No progress bar is shown if the value is zero

\bold{verbose} - logical. If \code{TRUE} debugging info is printed for some functions

\bold{tolerance} - numeric. difference in raster extent (expressed as the fraction of the raster resolution) that can be ignored when comparing alighnment of rasters.
}

\note{
Expand Down
4 changes: 2 additions & 2 deletions src/spatBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ std::vector<double> SpatRaster::origin() {

bool SpatRaster::compare_geom(SpatRaster &x, bool lyrs, bool crs, double tol, bool warncrs, bool ext, bool rowcol, bool res) {

tol = tol < 0 ? 0 : tol;
tol = tol < 0 ? 0 : (tol > 0.5 ? 0.5 : tol);

if (ext) {
SpatExtent extent = getExtent();
Expand All @@ -481,7 +481,7 @@ bool SpatRaster::compare_geom(SpatRaster &x, bool lyrs, bool crs, double tol, bo

if (lyrs) {
if (!(nlyr() == x.nlyr())) {
setError("number of layers does not match");
setError("number of layers does not match" + std::to_string(nlyr()) + " != " + std::to_string(x.nlyr()));
return false;
}
}
Expand Down

0 comments on commit f6f5554

Please sign in to comment.