View source: R/reduceRegions.R
rr | R Documentation |
This function allows the user to pass a previously created get_*() object to get reduceRegions() by using ee_as_sf function.
rr( data, geeFC = NULL, scale, tileScale = 1, band = NULL, lazy = FALSE, variable = NULL, leaflet = FALSE, palette = hcl.colors(n = 11), user_geom = NULL )
data |
A previously created get_* object or ee.image.Image |
geeFC |
A known GEE FeatureCollection or asset, e.g. "USGS/WBD/2017/HUC12" |
scale |
A |
tileScale |
|
band |
A |
lazy |
|
variable |
|
leaflet |
|
palette |
|
user_geom |
A sf object to use as 'region' for an 'ee.image.Image'. |
A leaflet map (leaflet = TRUE) and always a sf object.
If lazy is TRUE, the function will be run in the background. If the pixel size is big then please adjust tileScale to account for memory. This will not effect zonal stats (pixel size) but will just take longer. user_geom in this function is used when applying a non-get_*() function to rr(); this means you can provide a 'ee.image.Image' and a sf object to run rr().
## Not run: # Load Libraries library(rgee) ee_Initialize() library(exploreRGEE) # Bring in data huc <- exploreRGEE::huc ld8 <- get_landsat(huc, method = 'ld8', startDate = '2014-01-01', endDate = '2018-12-31', c.low = 6, c.high = 11) # without leaflet save to object ld8_rr <- ld8 %>% rr(scale = 30, band = 'NDVI') # with leaflet as side-effect ld8 %>% rr(scale = 30, band = 'NDVI', leaflet = TRUE, variable = 'name') # or side-effect leaflet and get sf object. ld8_ts <- ld8 %>% band(scale = 500, band = 'NDVI', leaflet = TRUE, variable = 'name') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.