Defines session-wide archive and AOI settings that are used by all getSpatialData functions

set_archive(dir_archive)

set_aoi(aoi)

view_aoi(color = "green")

get_aoi(type = "sf")

## Arguments

dir_archive character, directory to the getSpatialData archive folder. nothing, if an interactve mapedit viewer should open letting you draw an AOI polygon. Otherwise, sfc_POLYGON or SpatialPolygons or matrix, representing a single multi-point (at least three points) polygon of your area-of-interest (AOI). If it is a matrix, it has to have two columns (longitude and latitude) and at least three rows (each row representing one corner coordinate). If its projection is not +proj=longlat +datum=WGS84 +no_defs, it is reprojected to the latter. chracter, polygon filling color. character, AOI object type, either "matrix", "sf" or "sp".

None.

## Details

set_archive defines the session directory on your machine (or an external device) where getSpatialData should build up its donwload data archive. Since getSpatialData handles big amounts of data, it is recommended to once define a location where enough free storage is available and then afterwards to not change the archive location. You need to define the archives location for each session after loading getSpatialData. It will then be remembered for the duration of the session. Apart from the archive location, you can manually define a download path when calling the *_data functions. If you do not define a path there, getSpatialData will direct the download to the defined archive. The archive is structred by sensors.

set_aoi defines a session AOI that is used for querying data within the running session (if no other AOI is provided with a query function call). If called without argument, an interactive mapedit viewer is opened letting you draw an AOI polygon. Otherwise, the function supports sf, sp or matrix objects as aoi input (see argument aoi).

view_aoi displays the defined session AOI on an interactive mapview/leaflet map.

get_aoi returns the defined session AOI.

getSentinel_query getLandsat_query

## Examples

## set archive directory
dir.arc <- tempdir()
set_archive(dir.arc)

## set aoi (example aoi)
data("aoi_data")
set_aoi(aoi_data[[1]])# NOT RUN {
## draw aoi interactively
set_aoi() # just call without an argument

## view aoi
view_aoi()

## return aoi
aoi <- get_aoi(type = "sf")
# }