plot.ecors | R Documentation |
Plot Google Earth Engine images processed by get.ecors along with site and sample polygons.
## S3 method for class 'ecors' plot( x, ecors.type, visualization = "vis.bands", zoom = 10, defaults = T, legend = F, bands = NULL, pixel.min = NULL, pixel.max = NULL, image.gamma = NULL )
x |
ecors object (from get.ecors). |
ecors.type |
type of images processed by get.ecors. Options are "original", "filtered", "mask", "filtered|mask", "filtered+mask", "composite". More information in detais section. |
visualization |
choose preset options "vis.bands" (default visualization), "pan" (panchromatic band), "pan.sharpening" (panchromatic sharpening) or use "custom" to select bands. |
zoom |
initial zoom value. |
defaults |
if TRUE, uses default values of pixel.min, pixel.max, image.gamma and/or rescaling. |
legend |
choose to show the legend or not. |
bands |
select a single band to plot or three bands to plot RGB image. |
pixel.min |
lower pixel value used to scale the plot. |
pixel.max |
higher pixel value used to scale the plot. |
image.gamma |
gamma correction. |
Argument ecors.type selects which processing level of get.ecors will be ploted. Option "original" use all images available in the period without processing, "filtered" use only images approved in get.ecors quality control. Option "mask" use same images as the previous one but with bad pixels masked, "composite" use compositions performed on the images of the previous option. Options "filtered|mask" and "filtered+mask" show images from both collections. Option 2 and 3 show images from both collections, in the first the images are toggled with the slider and in the last option the images from both collections are stacked. in the first the images are toggled with the slider and in the last option the images from both collections are stacked
Google Earth Engine containers objects are exported to .GlobalEnv to be used in rgee functions and avoid errors (elapsed time limit):
img.samples: sample polygons,
img.site: site polygon,
img(i): plot object of a raster image (one object per image),
imgB(i): additional plot object of a raster image (one object per image) produced when selected "filtered|mask" or "filtered+mask",
leg: legend.
#get a ecors class object FAL.IBGE.JBB<-sf::st_read(system.file("extdata/FAL.IBGE.JBB.gpkg", package="ecors")) test.plots<-sf::st_read(system.file("extdata/Plots_tests.gpkg", package="ecors")) test.points<-sf::st_read(system.file("extdata/Points_tests.gpkg", package="ecors")) #library(ecors) d2020<-get.ecors(site=FAL.IBGE.JBB, points=test.points, plots=test.plots, buffer.points=500, buffer.plots=500, eval.area="site", projected=F, custom.crs=32723, collection="LANDSAT/LC08/C01/T1_TOA", start=c("2020-01-01"), end=c("2020-12-31"), bands.vis=T, indices=c("NDVI"), resolution=30, pOK=0.3, c.prob=NULL, c.dist=NULL, clouds.sentinel=NULL, cirrus.threshold=NULL, NIR.threshold=NULL, CDI.threshold=NULL, dmax.shadow=NULL, seasons=list(s1=c(11,12,1,2), s2=c(3,4), s3=c(5,6,7,8), s4=c(9,10)), group.by="season", composite=NULL) #Plotting #defaults plot(x=d2020, ecors.type="mask", visualization="vis.bands") plot(x=d2020, ecors.type="filtered+mask", visualization="vis.bands") #custom plot(x=d2020, ecors.type="mask", visualization="custom", defaults=F, legend=T, bands="NDVI", pixel.min=-1, pixel.max=1, image.gamma=NULL) #panchromatic sharpening plot(x=d2020, ecors.type="filtered", visualization="pan.sharpening")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.