Permalink
Browse files

Merge pull request #54 from CeresBarros/development

tolerate different resolutions between RTM and output raster when `useSAcrs = TRUE`
  • Loading branch information...
eliotmcintire committed Sep 14, 2018
2 parents ba28b75 + c41beb0 commit 3f68a90a4e704ed9647b31bac20f81e4c44dd86f
Showing with 4 additions and 1 deletion.
  1. +4 −1 R/postProcess.R
View
@@ -437,7 +437,10 @@ projectInputs.Raster <- function(x, targetCRS = NULL, rasterToMatch = NULL, ...)
warnings(warn)
## projectRaster doesn't always ensure equal res (floating point number issue)
## if resolutions are close enough, re-write res(x)
if (any(res(x) != res(rasterToMatch))) {
## note that when useSAcrs = TRUE, the different resolutions may be due to
## the different projections (e.g. degree based and meter based). This should be fine
if (identical(crs(x), crs(rasterToMatch)) &
any(res(x) != res(rasterToMatch))) {
if (all(res(x) %==% res(rasterToMatch))) {
res(x) <- res(rasterToMatch)
} else {

0 comments on commit 3f68a90

Please sign in to comment.