Given a polygon and date range, fetch Seascape data and return a raster layer for a single date or raster stack if multiple dates found for given date range.
SeaScape ERDDAP info object, as returned by
ed_info
)
polygon as spatial feature sf
, as returned by
get_url_ply
or bbox_to_ply
SeaScape variable. One of "CLASS" (default) or "P" for probability.
date begin to fetch, as character ("2003-01-15"
) or Date
(Date("2003-01-15")
). Defaults to first date available from ed_info
.
date end to fetch, as character ("2020-11-15"
) or Date
(Date("2020-11-15")
). Defaults to latest date available from ed_info
.
directory to cache results. Files are stored in the format
grd_{ed_var}_{date}.tif
so any other information needed, such as place or
SeaScape dataset should be captured by the containing folders so as to not
inadvertently write or read the wrong grid. This folder is consulted for
available dates before fetching any missing from the ERDDAP server.
Delete ERDDAP cache with
cache_delete_all
, which may be necessary if
underlying data changed. Default: FALSE.
display messages on status of function. Useful for debugging or showing status while getting data from a wide range and/or big polygon. Default: FALSE.
ply <- get_url_ply("mbnms")
#> Error in dir_create(dir_ply): could not find function "dir_create"
ed_i <- ed_info()
#> Error in ed_info(): argument "dataset" is missing, with no default
grds <- get_ed_grds(ed_i, ply, date_beg = "2020-01-01")
#> Error in get_ed_dates(ed_info): could not find function "get_ed_dates"
grds
#> Error in eval(expr, envir, enclos): object 'grds' not found