R/export.R
gd_export.Rd
Exports an encapsulated image to the destination specified by type
, folder
and filename
gd_export(
x,
filename,
type = "drive",
folder = dirname(filename),
region,
wait = TRUE,
...
)
An object that inherits from geedim.download.BaseImage
Output filename. If type
is "asset"
and folder
is not specified, filename
should be a valid Earth Engine asset ID.
Export type. Defaults to "drive"
; other options include "asset"
, and "cloud
". See gd_export_types()
Destination folder. Defaults to dirname(filename)
.
Region e.g. from gd_bbox()
or gd_region()
Wait for completion? Default: TRUE
Additional arguments to geedim.download.BaseImage.export()
an ee.batch.Task
object
See the geedim.mask.MaskedImage.export() documentation for details on additional arguments. Requires 'geedim' >1.6.0.
if (FALSE) {
if (gd_is_initialized()) {
r <- gd_bbox(
xmin = -120.6032,
xmax = -120.5377,
ymin = 38.0807,
ymax = 38.1043
)
i <- gd_image_from_id('CSP/ERGo/1_0/US/CHILI')
## export to Google Drive (default `type="drive"`)
# res <- gd_export(i, filename = "RGEEDIM_TEST.tif", scale = 100, region = r)
## export to `type="asset"`, then download by ID (stored in project assets)
# res <- gd_export(
# i,
# "RGEEDIM_TEST",
# type = "asset",
# folder = "your-project-name",
# scale = 100,
# region = r
# )
# gd_download("projects/your-project-name/assets/RGEEDIM_TEST", filename = "test.tif")
## export to Google Cloud Bucket with `type="cloud"`,
## where `folder` is the bucket path without `"gs://"`
# res <- gd_export(i, filename = "RGEEDIM_TEST.tif", type = "cloud",
# folder = "your-bucket-name", scale = 100, region = r)
}
}