Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ee_table_to_asset

Creates a task to export a FeatureCollection to an EE table asset.


Description

Creates a task to export a FeatureCollection to an EE table asset. This function is a wrapper around ee$batch$Export$table$toAsset(...).

Usage

ee_table_to_asset(
  collection,
  description = "myExportTableTask",
  assetId = NULL,
  overwrite = FALSE
)

Arguments

collection

The feature collection to be exported.

description

Human-readable name of the task.

assetId

The destination asset ID. **kwargs: Holds other keyword arguments that may have been deprecated.

overwrite

Logical. If TRUE, the assetId will be overwritten if it exists.

Value

An unstarted Task that exports the table to Earth Engine Asset.

See Also

Other vector export task creator: ee_table_to_drive(), ee_table_to_gcs()

Examples

## Not run: 
library(rgee)
library(stars)
library(sf)

ee_users()
ee_Initialize()

# Define study area (local -> earth engine)
# Communal Reserve Amarakaeri - Peru
rlist <- list(xmin = -71.13, xmax = -70.95,ymin = -12.89, ymax = -12.73)
ROI <- c(rlist$xmin, rlist$ymin,
         rlist$xmax, rlist$ymin,
         rlist$xmax, rlist$ymax,
         rlist$xmin, rlist$ymax,
         rlist$xmin, rlist$ymin)
ee_ROI <- matrix(ROI, ncol = 2, byrow = TRUE) %>%
  list() %>%
  st_polygon() %>%
  st_sfc() %>%
  st_set_crs(4326) %>%
  sf_as_ee()

amk_fc <- ee$FeatureCollection(
  list(ee$Feature(ee_ROI, list(name = "Amarakaeri")))
)

assetid <- paste0(ee_get_assethome(), '/geom_Amarakaeri')
task_vector <- ee_table_to_asset(
  collection = amk_fc,
  overwrite = TRUE,
  assetId = assetid
)
task_vector$start()
ee_monitoring(task_vector) # optional

ee_fc <- ee$FeatureCollection(assetid)
Map$centerObject(ee_fc)
Map$addLayer(ee_fc)

## End(Not run)

rgee

R Bindings for Calling the 'Earth Engine' API

v1.0.9
Apache License (>= 2.0)
Authors
Cesar Aybar [aut, cre] (<https://orcid.org/0000-0003-2745-9535>), Wu Qiusheng [ctb] (<https://orcid.org/0000-0001-5437-4073>), Lesly Bautista [ctb] (<https://orcid.org/0000-0003-3523-8687>), Roy Yali [ctb] (<https://orcid.org/0000-0003-4542-3755>), Antony Barja [ctb] (<https://orcid.org/0000-0001-5921-2858>), Kevin Ushey [ctb], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Tim Appelhans [ctb], JJ Allaire [ctb], Yuan Tang [ctb], Samapriya Roy [ctb], MariaElena Adauto [ctb] (<https://orcid.org/0000-0002-2154-2429>), Gabriel Carrasco [ctb] (<https://orcid.org/0000-0002-6945-0419>), Henrik Bengtsson [ctb], Jeffrey Hollister [rev] (Hollister reviewed the package for JOSS, see https://github.com/openjournals/joss-reviews/issues/2272/), Gennadii Donchyts [rev] (Gena reviewed the package for JOSS, see https://github.com/openjournals/joss-reviews/issues/2272/), Marius Appel [rev] (Appel reviewed the package for JOSS, see https://github.com/openjournals/joss-reviews/issues/2272/)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.