uploadPentadsToEE: Upload pentads to Google Earth Engine server

View source: R/uploadPentadsToEE.R

uploadPentadsToEER Documentation

Upload pentads to Google Earth Engine server

Description

Upload pentads to Google Earth Engine server

Usage

uploadPentadsToEE(pentads, asset_id, load = TRUE, max_p = 16250)

Arguments

pentads

An sf object with the pentads to upload

asset_id

A character string with the name we want our pentads to be saved on the server with.

load

If TRUE (default), the GEE asset is loaded into the R session.

max_p

Maximum number of pentads the function will try to upload without splitting into pieces. The default is a sensible choice but you can try modify it to serve your purposes.

Details

An sf object is uploaded to GEE servers via "getInfo_to_asset" (see sf_as_ee). If there are many pentads, the function will upload to objects and merge them in the server under the name provided. Please be conscious that two intermediate objects will also be stored under names "p1" and "p2". We recommend visiting your account and cleaning unnecesary objects regularly.

Value

Pentads are uploaded to GEE. In addition a GEE feature collection can be loaded into the R environment

Examples

## Not run: 
# Load ABAP pentads
pentads <- getRegionPentads(.region_type = "province", .region = "North West")

# Set an ID for your remote asset (data in GEE)
assetId <- sprintf("%s/%s", ee_get_assethome(), 'pentads')

# Upload to GEE (if not done already - do this only once per asset)
uploadPentadsToEE(pentads = pentads,
                  asset_id = assetId,
                  load = FALSE)

# Load the remote asset to you local computer to work with it
ee_pentads <- ee$FeatureCollection(assetId)

# Alternatively we can upload to GEE and load the asset in one call
ee_pentads <- uploadPentadsToEE(pentads = pentads,
                                asset_id = assetId,
                                load = TRUE)

## End(Not run)

AfricaBirdData/ABAP documentation built on Aug. 4, 2024, 4:41 p.m.