Download EE thumbnail images and read them as stars objects. This function is
a wrapper around ee$Image()$getThumbURL().
ee_as_thumbnail(x, region, dimensions, vizparams = NULL, crs = 4326, quiet = FALSE)
| x | EE Image object |
|---|---|
| region | Geospatial region of the image (c(E,S,W,N) numeric vector, EE Geometry, or sfg). By default, the whole image is used. |
| dimensions | A number or pair of numbers in format XY. |
| vizparams | A list that contains the visualization parameters. |
| crs | The EE Image projection e.g. 'EPSG:3857'. Defaults to WGS84 ('EPSG:4326'). |
| quiet | logical; suppress info messages. |
An sf object
The argument dimensions will define the "from" & "to" parameters of the stars object to be generated. It must be a single numeric value or a two-element vector. If not defined, 256 is taken by default as the dimension of x (from 1 to 256), and y will be computed by proportional scaling. Huge images might cause plodding connections. See Client vs Server for details.
The vizparams set up the number of bands. In ee_as_thumbnail just is possible export one (G) or
three band (RGB) images, additional parameters can be passed on to control color, intensity,
the max(min) value, etc. See below for a more compressible list of all the parameters that admit
ee_as_thumbnail.
| Parameter | Description | Type |
| bands | Comma-delimited list of three band names to be mapped to RGB | list |
| min | Value(s) to map to 0 | number or list of three numbers, one for each band |
| max | Value(s) to map to 1 | number or list of three numbers, one for each band |
| gain | Value(s) by which to multiply each pixel value | number or list of three numbers, one for each band |
| bias | Value(s) to add to each DN | number or list of three numbers, one for each band |
| gamma | Gamma correction factor(s) | number or list of three numbers, one for each band |
| palette | List of CSS-style color strings (single-band images only) | comma-separated list of hex strings |
| opacity | The opacity of the layer (0.0 is fully transparent and 1.0 is fully opaque) | number |
Use ee$Image()$geometry()$projection()$crs()$getInfo() for getting the CRS of an Earth Engine Image.
#>#>#>#> Reading layer `arequipa' from data source `/tmp/RtmpQd4Uh9/temp_libpath739d4b3f58dc/rgee/shp/arequipa.shp' using driver `ESRI Shapefile' #> Simple feature collection with 1 feature and 2 fields #> geometry type: POLYGON #> dimension: XY #> bbox: xmin: -75.07333 ymin: -17.28501 xmax: -70.80408 ymax: -14.63274 #> epsg (SRID): 4326 #> proj4string: +proj=longlat +datum=WGS84 +no_defsdem_palette <- c("#008435", "#1CAC17", "#48D00C", "#B3E34B", "#F4E467", "#F4C84E", "#D59F3C", "#A36D2D", "#C6A889", "#FFFFFF") ndvi_palette <- c("#FC8D59", "#FC8D59", "#FC9964", "#FED89C", "#FFFFBF", "#FFFFBF", "#DAEF9F", "#9DD46A", "#91CF60", "#91CF60") # Example 01 - SRTM AREQUIPA-PERU image <- ee$Image("CGIAR/SRTM90_V4") region <- nc$geometry[[1]] arequipa_dem <- ee_as_thumbnail(x = image, region = region, vizparams = list(min = 0, max = 5000))#>#> #> #>#> #> #>#> dimensions is missing, 256 is taken by default as dimension of x (from 1 to 256). #> Getting the thumbnail image from Earth Engine ... please waitarequipa_dem <- arequipa_dem * 5000 plot(arequipa_dem[nc], col = dem_palette, breaks = "equal", reset = FALSE, main = "SRTM - Arequipa")#>