You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#' Downloads resources based on stored results or selected indices of results.
41
-
#' @param output_dir A string specifying the directory where downloaded files will be saved, defaulting to the current directory.
41
+
#' @param output_dir A string specifying the directory where downloaded files will be saved.
42
42
#' @param selected_indexes Optional; indices of the specific results to download.
43
43
#' @param stop_at_failure Optional; controls whether the download process of multiple files should immediately stop upon encountering the first failure.
44
44
#' @return Nothing returned but downloaded files are saved at the specified location.
@@ -125,9 +129,13 @@ To search for data in the HDA service, you need to create a query template. Manu
125
129
## Basic Usage
126
130
127
131
The `generate_query_template` function generates a template of a query for a specified dataset. This function fetches information about existing parameters, default values, etc., from the `/queryable` endpoint of the HDA service.
132
+
The `generate_query_template` function generates a template of a query for a specified dataset. This function fetches information about existing parameters, default values, etc., from the `/queryable` endpoint of the HDA service.
133
+
134
+
#### Example: Generating a Query
128
135
129
136
#### Example: Generating a Query
130
137
138
+
Here is an example of how to generate a query template for the dataset with the ID "EO:EEA:DAT:CLMS_HRVPP_ST":
131
139
Here is an example of how to generate a query template for the dataset with the ID "EO:EEA:DAT:CLMS_HRVPP_ST":
"uid": "__### Value of string type with pattern: [\\w-]+",
208
+
"productType": "PPI",
209
+
"platformSerialIdentifier": "S2A, S2B",
210
+
"tileId": "__### Value of string type with pattern: [\\w-]+",
211
+
"productVersion": "__### Value of string type with pattern: [\\w-]+",
212
+
"resolution": "10",
213
+
"processingDate": "__### Value of string",
214
+
"start": "__### Value of string",
215
+
"end": "__### Value of string",
216
+
"bbox": [
217
+
-180,
218
+
-90,
219
+
180,
220
+
90
221
+
]
222
+
}
194
223
```
195
224
225
+
```{r, eval = FALSE}
226
+
# convert to list for easier manipulation in R
227
+
library(jsonlite)
228
+
query_template <- fromJSON(query_template)
229
+
query_template
230
+
$dataset_id
231
+
[1] "EO:EEA:DAT:CLMS_HRVPP_ST"
232
+
233
+
$uid
234
+
[1] "__### Value of string type with pattern: [\\w-]+"
235
+
236
+
$productType
237
+
[1] "PPI"
238
+
239
+
$platformSerialIdentifier
240
+
[1] "S2A, S2B"
241
+
242
+
$tileId
243
+
[1] "__### Value of string type with pattern: [\\w-]+"
244
+
245
+
$productVersion
246
+
[1] "__### Value of string type with pattern: [\\w-]+"
247
+
248
+
$resolution
249
+
[1] "10"
250
+
251
+
$processingDate
252
+
[1] "__### Value of string"
253
+
254
+
$start
255
+
[1] "__### Value of string"
256
+
257
+
$end
258
+
[1] "__### Value of string"
259
+
260
+
$bbox
261
+
[1] -180 -90 180 90
262
+
```
263
+
264
+
## Modify and use the generated Query Template
265
+
196
266
## Modify and use the generated Query Template
197
267
268
+
You can and should customize the generated query template to fit your specific needs. Fields starting with '\_\_###' are placeholder values indicating possible values, but if unchanged it will be stripped off before sending the query to the HDA service.
198
269
You can and should customize the generated query template to fit your specific needs. Fields starting with '\_\_###' are placeholder values indicating possible values, but if unchanged it will be stripped off before sending the query to the HDA service.
199
270
200
271
Here is an example of how to use the query template in a search:
The `SearchResults` class has a public field results and a method called download that is responsible for downloading the found data. The `download()` function takes an output directory (which is created if no existing) and the optional parameter `selected_indexes` to specify which files to download.
270
391
The `SearchResults` class has a public field results and a method called download that is responsible for downloading the found data. The `download()` function takes an output directory (which is created if no existing) and the optional parameter `selected_indexes` to specify which files to download.
271
392
272
393
```{r, eval = FALSE}
273
394
# Assuming 'matches' is an instance of SearchResults obtained from the search
274
-
odir <- "~/deleteme"
395
+
odir <- tempdir()
275
396
matches$download(odir)
276
-
The total size is 1.8 GB . Do you want to proceed? (Y/N):
397
+
The total size is 1.8 GB . Do you want to proceed? (Y/N):
0 commit comments