+
+
+
Get Wekeo data using Earthkit
+
+
+
+
Usage
+
get_wekeo_data(
+ dataset_id,
+ api_request,
+ bbox = NULL,
+ productType,
+ resolution,
+ startdate,
+ enddate,
+ itemsPerPage = 200,
+ startIndex = 0
+)
+
+
+
+
Arguments
+
+
+
- dataset_id
+The dataset identifier.
+
+
+- api_request
+The API request in JSON format.
+
+
+- bbox
+A bounding box for the data request (optional).
+
+
+- productType
+The type of product to request (optional).
+
+
+- resolution
+The resolution of the data (optional).
+
+
+- startdate
+The start date for the data request (optional).
+
+
+- enddate
+The end date for the data request (optional).
+
+
+- itemsPerPage
+The number of items per page (default is 200).
+
+
+- startIndex
+The starting index for pagination (default is 0).
+
+
+
+
Value
+
A terra SpatRaster object containing the requested data.
+
+
+
Details
+
This function retrieves data from the Wekeo service using the Earthkit library.
+It constructs an API request based on the provided parameters and downloads the data.
+This function is a wrapper around the earthkit_download
from python function.
+To get this function to work, you need to have the earthkit
python package installed
+which depends on the Microsoft C++ Build Tools
.
+This toolkit is required to compile the earthkit
package.
+To install the toolkit please place ict helpdesk call at ict.helpdesk@inbo.be
+
When no API request is provided the function constructs a custom API request.
+When the API request is provided, it will be used directly, ignoring the other parameters (except dataset_id).
+
+
+
+
Author
+
Martijn Bollen & Sander Devisscher
+
This function retrieves data from the Wekeo service using the Earthkit library.
+
+
+
+
Examples
+
if (FALSE) { # \dontrun{
+
+# Set up the virtual environment and install required python packages
+py_env <- "myenv" # Change this to your desired virtual environment name
+# 0. Create the virtualenv if needed
+if (!py_env %in% reticulate::virtualenv_list()) {
+ reticulate::virtualenv_create(py_env)
+}
+
+# 1. Activate the environment for the session
+reticulate::use_virtualenv(py_env, required = TRUE)
+
+# 2. Install Python packages if not already installed
+if (!reticulate::py_module_available("hda")) {
+ message("Installing Python module 'hda'...")
+ reticulate::virtualenv_install(py_env,"hda")
+}
+if (!reticulate::py_module_available("earthkit")) {
+ message("Installing Python module 'earthkit'...")
+ reticulate::virtualenv_install(py_env,"earthkit")
+}
+
+# Example usage with a custom API request
+api_request <- '{
+"dataset_id": "EO:CLMS:DAT:CLMS_GLOBAL_NDVI_300M_V1_10DAILY_NETCDF",
+"resolution": "300",
+"bbox": [
+ 1.6063443461063671,
+ 48.05229722213296,
+ 8.35299059975311,
+ 51.7736550957488
+],
+"startdate": "2021-01-01T00:00:00.000Z",
+"enddate": "2021-01-01T23:59:59.999Z",
+"itemsPerPage": 200,
+"startIndex": 0
+}'
+
+data <- get_wekeo_data(
+ dataset_id = "EO:CLMS:DAT:CLMS_GLOBAL_NDVI_300M_V1_10DAILY_NETCDF",
+ api_request = api_request
+)
+} # }
+
+
+