Skip to content

COG and addRasterRGB #60

Description

@Tartomas

Hi leafem Team!
I'm wondering how can I try a COG RGB image (S2 or drone) base on your solution of leafem:::addCog. I have already work around single bands but I cant find any example using COG with RGB and other parameters like bands selection layers or stretching.

I have a multi band 9 layers of sentinel 2


sr = 'https://storage.googleapis.com/terramodels-prod/raster/BLACK_GLACIER/ANDES/SR/SR_S2SR_T19HCD_2019-01-01.tif'

leaflet(options = leafletOptions(attributionControl = FALSE)) %>% 
  setView(lng =-70.09841, lat = -33.037, zoom = 13) %>% 
  addTiles(group = "osm") %>% 
  addMapPane("cog", zIndex = 500) %>%
  leafem:::addCOG(
    url = sr, 
    group = "RGB", opacity = 0.7, 
    options = list(pane = "cog"), 
    resolution = 16,
    autozoom = FALSE,
    rgb = TRUE
    # , colorOptions = colorOptions(
    #   palette = grDevices::hcl.colors(3, "Inferno")
    #   , breaks = seq(0, 1, 0.2)
    #   , domain = c(0, 100)
    #   , na.color = "#ff00ff88"
    # )
    # , pixelValuesToColorFn = JS(js_scale)
  ) %>%
 
  # addMouseCoordinates() %>%
  addLayersControl(
    baseGroups = c("esri")
    , overlayGroups =  c("RGB")
  )

Best regards!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions