Description Usage Arguments Details Value Examples
View source: R/ee_imagecollection.R
Save an EE ImageCollection in their local system
1 2 3 4 5 6 7 8 9 10 | ee_imagecollection_to_local(
ic,
region,
dsn = NULL,
via = "getInfo",
scale = NULL,
maxPixels = 1e+09,
container = "rgee_backup",
quiet = FALSE
)
|
ic |
ee$ImageCollection to be saved in the system. |
region |
EE Geometry Rectangle (ee$Geometry$Rectangle). The CRS needs to be the same that the ic argument otherwise it will be forced. |
dsn |
Character. Output filename. If missing,
|
via |
Character. Method to fetch data about the object. Multiple options supported. See details. |
scale |
Numeric. The resolution in meters per pixel. Defaults to the native resolution of the image assset. |
maxPixels |
Numeric. The maximum allowed number of pixels in the exported image. The task will fail if the exported region covers more pixels in the specified projection. Defaults to 100,000,000. |
container |
Character. Name of the folder ('drive') or bucket ('gcs')
to be exported into (ignored if |
quiet |
logical. Suppress info message |
ee_imagecollection_to_local
supports the download of ee$Image
by three different options: "getInfo", "drive", and "gcs". When "getInfo"
is set in the via
argument, ee_imagecollection_to_local
will
make an REST call to retrieve all the known information about the object.
The advantage of use "getInfo" is a direct and faster download. However,
there is a limitation of 262144 pixels by request which makes it not
recommendable for large images. Instead of "getInfo", the options: "drive"
and "gcs" are suitable for large collections since they use an intermediate
container. They use Google Drive and Google Cloud Storage respectively. For
getting more information about exporting data take a look at the
Google Earth
Engine Guide - Export data.
A character object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | ## Not run:
library(rgee)
library(raster)
# Initialize a specific Earth Engine account and load
# either Google Drive or Google Cloud Storage credentials
ee_reattach()
ee_Initialize(
email = "data.colec.fbf@gmail.com",
drive = TRUE,
gcs = TRUE
)
# USDA example
loc <- ee$Geometry$Point(-99.2222, 46.7816)
collection <- ee$ImageCollection('USDA/NAIP/DOQQ')$
filterBounds(loc)$
filterDate('2008-01-01', '2020-01-01')$
filter(ee$Filter$listContains("system:band_names", "N"))
# From ImageCollection to local directory
ee_crs <- collection$first()$projection()$getInfo()$crs
geometry <- collection$first()$geometry(proj = ee_crs)$bounds()
tmp <- tempdir()
## Using getInfo
ic_getinfo_files <- ee_imagecollection_to_local(
ic = collection,
region = geometry,
scale = 100,
dsn = tmp,
via = "getInfo",
quiet = TRUE
)
## Using drive
ic_drive_files <- ee_imagecollection_to_local(
ic = collection,
region = geometry,
scale = 100,
dsn = file.path(tmp, "drive_"),
via = "drive"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.