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 c4428e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Description: The original fire model is described by Cumming et al. (1998),
URL: https://scfmutils.predictiveecology.org,
https://github.com/PredictiveEcology/scfmutils,
https://predictiveecology.github.io/scfmutils/
Date: 2024-05-09
Version: 0.0.13.9001
Date: 2024-06-05
Version: 0.0.13.9002
Authors@R: c(
person("Steve", "Cumming", email = "[email protected]",
role = c("aut")),
Expand Down
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 c4428e9

Please sign in to comment.