Skip to content

Commit

Permalink
grab rasters
Browse files Browse the repository at this point in the history
  • Loading branch information
ramarty committed Nov 5, 2024
1 parent 6011700 commit 1df6a64
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/blackmarbler.R
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,11 @@ bm_extract <- function(roi_sf,
".Rds")
out_name <- paste0(out_name_begin, out_name_end)

## Restrict to files that exist, in case user enters date with no data
## (eg, year after current year)
all_files <- list.files(file_dir)
out_name <- out_name[out_name %in% all_files]

r <- file.path(file_dir, out_name) %>%
map_df(readRDS)

Expand Down Expand Up @@ -1169,6 +1174,11 @@ bm_raster <- function(roi_sf,
".tif")
out_name <- paste0(out_name_begin, out_name_end)

## Restrict to files that exist, in case user enters date with no data
## (eg, year after current year)
all_files <- list.files(file_dir)
out_name <- out_name[out_name %in% all_files]

r <- file.path(file_dir, out_name) %>%
rast()

Expand Down

0 comments on commit 1df6a64

Please sign in to comment.