r-spatial / rgee

Google Earth Engine for R
https://r-spatial.github.io/rgee/
Other
677 stars 146 forks source link

Using Planet in rgee #225

Closed Leprechault closed 2 years ago

Leprechault commented 2 years ago

Hi Everyone!!

I'd like to know if is possible to using rgee for download Planet's imagery using a personal Planet API key? We have a Planet tutorial for Google Earth Engine (https://developers.planet.com/docs/integrations/gee/gee/) but it's possible the rgee integration?

Thanks in advance,

Alexandre

csaybar commented 2 years ago

Hi @Leprechault.

I'm not familiar with the Planet API, but it seems to be pretty handy! ... There should be no problem to integrate planet with rgee: https://developers.planet.com/docs/integrations/gee/quickstart/. Besides, Map$addLayer supports COG object visualization using titiler in the backend. See Map documentation! https://r-spatial.github.io/rgee/reference/R6Map.html

library(rgee)
server <- "https://storage.googleapis.com/pdd-stac/disasters/"
file <- "hurricane-harvey/0831/20170831_172754_101c_3B_AnalyticMS.tif"
resource <- paste0(server, file)
visParams <- list(bands = c("B3", "B2", "B1"), min = 3000, max = 13500, nodata = 0)
Map$centerObject(resource)
Map$addLayer(resource, visParams = visParams, shown = TRUE)
Leprechault commented 2 years ago

Thanks @csaybar!!! Using GEE plugin in Google Cloud works!!