Skip to content

Commit

Permalink
properly fix for prepInputsFireRegimePolys when url supplied by user
Browse files Browse the repository at this point in the history
  • Loading branch information
achubaty committed Jun 5, 2024
1 parent 9eef396 commit 801af93
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions R/utils_fireRegimePolys.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,20 @@ prepInputsFireRegimePolys <- function(url = NULL, destinationPath = tempdir(),
tmp <- sf::st_transform(tmp, sf::st_crs(studyArea))
}
}
} else {
tmp <- prepInputs(url = url,
destinationPath = destinationPath,
studyArea = studyArea,
rasterToMatch = rasterToMatch,
fun = "sf::st_read",
overwrite = TRUE) ## TODO: doesn't reproject -- fix upstream?

## workaround issues with prepInputs() not reprojecting:
if (!is.null(rasterToMatch)) {
tmp <- sf::st_transform(tmp, raster::crs(rasterToMatch))
} else if (is.null(rasterToMatch) && !is.null(studyArea)) {
tmp <- sf::st_transform(tmp, sf::st_crs(studyArea))
}
}

if (grepl("^ECO", type)) {
Expand Down

0 comments on commit 801af93

Please sign in to comment.