ee_get: Return the element at the specified position in a Earth...

Description Usage Arguments Value Examples

View source: R/ee_get.R

Description

Return the element at the specified position in a Earth Engine Collection

Usage

1
ee_get(ee_c, index = 0)

Arguments

ee_c

ImageCollection or FeatureCollection.

index

Numeric. Specified position.

Value

Depending of ee_c can return either an ee$FeatureCollection or ee$ImageCollection.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
library(rgee)
library(sf)

ee_Initialize()

nc <- st_read(system.file("shape/nc.shp", package = "sf")) %>%
  st_transform(4326) %>%
  sf_as_ee()

ee_s2 <- ee$ImageCollection("COPERNICUS/S2")$
  filterDate("2016-01-01", "2016-01-31")$
  filterBounds(nc)

ee_s2$size()$getInfo() # 126

# Get the first 5 elements
ee_get(ee_s2, index = 0:4)$size()$getInfo() # 5

## End(Not run)

csaybar/rgee documentation built on March 11, 2021, 5:48 a.m.