ee_viz: Viz-ualize GEE Image/ImageCollections

View source: R/viz.R

ee_vizR Documentation

Viz-ualize GEE Image/ImageCollections

Description

This function allows users to quickly view a previously created get_*() object or ee.image.Image.

Usage

ee_viz(x, ...)

## S3 method for class 'ee.image.Image'
ee_viz(
  x,
  scale = 1000,
  geom = NULL,
  band = NULL,
  palette = hcl.colors(11, "RdBu"),
  range = NULL,
  gamma = NULL,
  opacity = NULL,
  ...
)

## S3 method for class 'exploreList'
ee_viz(
  x,
  scale = 1000,
  band = NULL,
  palette = hcl.colors(11, "RdBu"),
  range = NULL,
  gamma = NULL,
  opacity = NULL,
  ...
)

Arguments

x

A previously created get_* object or ee.image.Image

...

extra args to pass on

scale

A numeric value indicating scale in meters. 250 (default)

geom

A sf object to use as 'aoi/geom' for an 'ee.image.Image'.

band

A character indicating what bands/type to visualize. Can select more than one, e.g. c('Red', 'Green', 'Blue').

palette

vector of a color palette.

range

vector indicating a numerical range to set min/max visualization.

gamma

numeric gamma correction factor.

opacity

numeric transparent display value.

Value

A leaflet map.

Note

This function uses a scale argument which is used to generate a min and max value for viewing. Because this uses getInfo(), it can take a while depending on the scale. Since this is used for viewing, I would suggest to go bigger on the scale. If a user selects more than one band, the 'up-to' three bands will be overlayed like earth engine.

Examples

## 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)

ld8 %>% ee_viz(scale = 30, band = 'NDVI', palette = 'RdYlGn')

# or without scale, when min and max are used scale is irrelevant.

ld8 %>% ee_viz(min = 0, max = 1, band = 'NDVI', palette = 'RdYlGn')


## End(Not run)



joshualerickson/exploreRGEE documentation built on May 9, 2022, 10:33 p.m.