Learn R Programming

rgee (version 0.5.0)

+,mapview,mapview-method: mapview + mapview; adds data from the second map to the first

Description

mapview + mapview; adds data from the second map to the first

Usage

# S4 method for mapview,mapview
+(e1, e2)

Arguments

e1

a mapview map to which e2 should be added.

e2

a mapview map from which the objects should be added to e1.

Examples

Run this code
# NOT RUN {
library(rgee)
ee_reattach() # reattach ee as a reserved word
ee_Initialize()

# Case 1: Geometry*
geom <- ee$Geometry$Point(list(-73.53, -15.75))
Map$centerObject(geom, zoom = 13)
m1 <- Map$addLayer(
  eeObject = geom,
  visParams = list(
    pointRadius = 10,
    color = "FF0000"
  ),
  name = "Geometry-Arequipa"
)
# Case 2: Feature
eeobject_fc <- ee$FeatureCollection("users/csaybar/DLdemos/train_set")$
  first()
m2 <- Map$addLayer(
  eeObject = ee$Feature(eeobject_fc),
  name = "Feature-Arequipa"
)
m2 + m1

# Case 3: FeatureCollection
eeobject_fc <- ee$FeatureCollection("users/csaybar/DLdemos/train_set")
Map$centerObject(eeobject_fc)
m3 <- Map$addLayer(eeObject = eeobject_fc, name = "FeatureCollection")
m3 + m2 + m1

# Case 4: Image
image <- ee$Image("LANDSAT/LC08/C01/T1/LC08_044034_20140318")
Map$centerObject(image)
m4 <- Map$addLayer(
  eeObject = image,
  visParams = list(
    bands = c("B4", "B3", "B2"),
    max = 10000
  ),
  name = "SF"
)
m4
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab