Skip to content

Commit

Permalink
gd_download: fix overwrite=TRUE for composite=FALSE
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Jan 4, 2024
1 parent 1976dfe commit 3a43cae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rgeedim
Type: Package
Title: Search, Composite, and Download 'Google Earth Engine' Imagery with the 'Python' Module 'geedim'
Version: 0.2.6
Version: 0.2.7
Authors@R: c(person("Andrew", "Brown", role = c("aut", "cre"), email = "brown.andrewg@gmail.com"),
person("Dugal", "Harris", role = "cph", comment = "'geedim' 'Python' module"))
Maintainer: Andrew Brown <brown.andrewg@gmail.com>
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# rgeedim 0.2.6

* `gd_authenticate()`: Updates

- Added `force` and `scopes` arguments from `earthengine()$Authenticate()`. `force` defaults to `TRUE` for consistency with prior behavior, and because users often want to use `gd_authenticate()` to change existing credentials.
Expand All @@ -13,6 +14,8 @@

* Argument updates compatible with older versions of earthengine-api (< 0.1.382)

* `gd_download()` fix bug that prevented overwriting files with `overwrite=TRUE` when `composite=FALSE`

# rgeedim 0.2.5

* Update example for `gd_enum_names()`
Expand Down
2 changes: 1 addition & 1 deletion R/download.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ gd_download <- function(x,
}
fp <- sprintf(file.path(dest, paste0(basename(y), "_%sm.tif")),
ifelse(scale < 1000, scale, paste0(scale / 1000, "k")))
if (!file.exists(fp)) {
if (overwrite || !file.exists(fp)) {
y <- gd_download(img, fp, region = region, scale = scale, silent = silent, overwrite = overwrite, ...)
}
# update names; TODO get this fixed in geedim
Expand Down

0 comments on commit 3a43cae

Please sign in to comment.