Description Usage Arguments Value Author(s) References Examples
Plot image TS chips based on a location, area buffer, and time buffer
1 2 3 |
x |
RasterBrick. Image time series brick |
loc |
Location. Can be a vector of length 2 representing the x,y coordinates, or a SpatialPolygons or SpatialPoints object of |
start |
Date. OptionaL: earliest date ("yyyy-dd-mm") to display. |
end |
Date. Optional: latest date ("yyyy-dd-mm") to display. |
buff |
Numeric. Number of pixels to buffer the location in all directions. A higher buffer will essentially zoom out. |
percNA |
Numeric. Maximum allowable % NA in the cropped image chips |
cols |
Character. Name of colour map to use (see display.brewer.all()) or a character vector with two or more colour names or hexadecimal values (as strings) between which to interpolate. |
nbks |
Numeric. Number of breaks in the colour map |
plot |
Logical. Plot pixel time series? |
plotlab |
Character. y-axis label for the pixel time series plot. |
exportChips |
Logical. Export processed chips to workspace as a rasterBrick? |
exportZoo |
Logical. Export pixel time series as a zoo object? |
show |
Logical. Plot the chips? Can be set to |
nc/nr |
Numeric. Number of columns and rows to plot, respectively. If the number of layers is greater than |
NULL
if exportChips = FALSE
and exportZoo = FALSE
, with the side effect of time series chips being plotted. If exportChips = TRUE
, an object of type RasterBrick
. if exportZoo = TRUE
, an object of type zoo
.
Ben DeVries
Cohen, W. B., Yang, Z., Kennedy, R. (2010). Detecting trends in forest disturbance and recovery using yearly Landsat time series: 2. TimeSync - Tools for calibration and validation. Remote Sensing of Environment, 114(12), 2911-2924.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ## Not run:
library(bfastSpatial)
data(tura)
tsChips(tura, loc = c(820796, 831198))
tsChips(tura, loc = c(820796, 831198), buff = 50) # zoom out
tsChips(tura, loc = c(820796, 831198), buff = 50, percNA = 80) # allow more NA's in field of view
tsChips(tura, loc = c(820796, 831198), start = "2007-01-01", end = "2012-01-01", plot = TRUE, plotlab = 'NDVI') # restrict dates and produce pixel time series plot afterwards
# alternative colour scales
library(RColorBrewer)
display.brewer.all()
tsChips(tura, loc = c(820796, 831198), start = "1999-01-01", cols = "Spectral")
tsChips(tura, loc = c(820796, 831198), start = "1999-01-01", cols = "Greens")
tsChips(tura, loc = c(820796, 831198), start = "1999-01-01", cols = c("red", "yellow", "blue"))
tsChips(tura, loc = c(820796, 831198), start = "1999-01-01", cols = c("#DEEBF7", "#3182BD"))
# export image chips as a raster brick
chips <- tsChips(tura, loc = c(820796, 831198), start = "1999-01-01", percNA = 0, exportChips = TRUE)
chips2 <- tsChips(tura, loc = c(820796, 831198), start = "1999-01-01", percNA = 100, exportChips = TRUE)
nlayers(chips)
nlayers(chips2)
# export centre pixel time series as a zoo object
z <- tsChips(tura, loc = c(820796, 831198), start = "1999-01-01", exportZoo = TRUE)
plot(z)
# draw a custom SpatialPoygons object and plot around that
plot(tura, 42)
pol <- drawPoly(sp = TRUE) # click 'Finish' in plot window when done
projection(pol) <- projection(tura)
plot(tura, 42); plot(pol, add=TRUE)
tsChips(tura, loc = pol, start = "1999-01-01", plot = TRUE, plotlab = 'NDVI')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.