Functions that define session-wide archive and AOI settings that are used by all getSpatialData functions and check for the availability of used online services.

set_archive(dir_archive, create = T)


view_aoi(color = "green")

get_aoi(type = "sf")

services_avail(value = F)



character, directory to the getSpatialData archive folder.


logical, whether to create directory, if not existing or not.


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".


logical, whether to return a data frame containing service status or not. Default is FALSE.




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.

services_avail displays the status of all online services used by getSpatialData. Services that are operating as usual are labeled "available". Returns a data.frame containing the service status, if argument value is set to TRUE.

See also

getSentinel_query getLandsat_query


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

## set aoi (example aoi)

# }# NOT RUN {
## draw aoi interactively
set_aoi() # just call without an argument

## view aoi

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