Description Usage Arguments Details Value Author(s) Examples
Flatten a brick by iteratively masking layer values by non-NA values in preceding layers. An optional threshold can be supplied, where preceding values exceeding the threshold are ignored in the masking procedure (and are therefore themselves removed).
1 | flattenBrick(x, thresh = NULL, ...)
|
x |
RasterBrick or RasterStack. |
thresh |
Numeric. Optional: threshold to apply to preceding values in deciding whether to mask subsequent values. |
... |
Additional arguments to be bassed to |
thresh
only works on a 'greater-than' basis. To achieve the reverse, first let x <- -1*x
then convert the result back by y <- -1*y
.
RasterLayer with values representing 'earliest' encountered values not exceeding thresh
.
Ben DeVries
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # load Tura dataset
data(tura)
## apply a very crude gap-fill using 2 Landsat
# the 1st layer has alot of gaps from the cloud mask
# suppose this is our target image and we want to use the 2nd layer to fill
# just take these two layers
gapfill <- tura[[c(1:2)]]
names(gapfill) <- c("target", "fill")
plot(gapfill)
# flatten the Brick to fill the gaps (NA's in the 1st layer)
filled <- flattenBrick(gapfill)
plot(filled)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.