Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
achubaty committed Nov 22, 2018
1 parent 8bb1b1b commit b913a5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ importFrom(dplyr,select)
importFrom(fastdigest,fastdigest)
importFrom(fasterize,fasterize)
importFrom(fpCompare,"%==%")
importFrom(gdalUtils,gdal_setInstallation)
importFrom(gdalUtils,gdalwarp)
importFrom(git2r,checkout)
importFrom(git2r,clone)
Expand Down
14 changes: 9 additions & 5 deletions R/postProcess.R
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ projectInputs.default <- function(x, targetCRS, ...) {
#' @export
#' @rdname projectInputs
#' @importFrom fpCompare %==%
#' @importFrom gdalUtils gdalwarp
#' @importFrom gdalUtils gdal_setInstallation gdalwarp
#' @importFrom raster crs dataType res res<- dataType<-
projectInputs.Raster <- function(x, targetCRS = NULL, rasterToMatch = NULL, ...) {
dots <- list(...)
Expand Down Expand Up @@ -484,7 +484,9 @@ projectInputs.Raster <- function(x, targetCRS = NULL, rasterToMatch = NULL, ...)
gdalUtils::gdal_setInstallation()
if (.Platform$OS.type == "windows") {
exe <- ".exe"
} else exe <- ""
} else {
exe <- ""
}

if (is.null(dots$method)) {
dots$method <- assessDataType(x, type = "projectRaster")
Expand All @@ -504,9 +506,11 @@ projectInputs.Raster <- function(x, targetCRS = NULL, rasterToMatch = NULL, ...)
}

teRas <- " " #This sets extents in GDAL
if (!is.null(rasterToMatch)){
teRas <- paste0(" -te ", paste0(extent(rasterToMatch)@xmin, " ", extent(rasterToMatch)@ymin, " ",
extent(rasterToMatch)@xmax, " ", extent(rasterToMatch)@ymax, " "))
if (!is.null(rasterToMatch)) {
teRas <- paste0(" -te ", paste0(extent(rasterToMatch)@xmin, " ",
extent(rasterToMatch)@ymin, " ",
extent(rasterToMatch)@xmax, " ",
extent(rasterToMatch)@ymax, " "))
}

dType <- assessDataType(raster(tempSrcRaster), type = "GDAL")
Expand Down

0 comments on commit b913a5a

Please sign in to comment.