Description Usage Arguments Value Author(s) See Also Examples
Batcher to process Landsat data from tarball or hdf to a list of Vegetation Index files. Runs processLandsat sequentially or in parallel
1 | processLandsatBatch(x, pattern = NULL, outdir, srdir, mc.cores = 1, ...)
|
x |
Character. Directory where the data is located. Data can be of the following formats: hdf, geoTiff, tar.gz or zip) |
pattern |
Only useful if x if of length 1. See list.files for more details |
outdir |
Character. Directory where the vegetation index rasterLayer should be written. |
srdir |
Character. Directory where the tarball should be uncompressed. Can be ommited if |
mc.cores |
Numeric. For multicore implementation only. See mclapply |
... |
Arguments to be passed to processLandsat ( |
Function is used for its side effect of calculating in batch mode Vegetation indices from surface reflectance Landsat data.
Loic Dutrieux
processLandsat and sr2vi
1 2 3 4 5 6 7 8 9 10 11 | # Get the directory where the Landsat archives are stored
dir <- system.file('external', package='bfastSpatial')
# Set the location of output and intermediary directories (everything in tmpdir in that case)
srdir <- dirout <- file.path(rasterOptions()$tmpdir, 'bfmspatial')
dir.create(dirout, showWarning=FALSE)
processLandsatBatch(x=dir, pattern=glob2rx('*.zip'), outdir=dirout, srdir=srdir, delete=TRUE, vi='ndvi', mask='fmask', keep=0, overwrite=TRUE)
# Visualize one of the layers produced
list <- list.files(dirout, pattern=glob2rx('*.grd'), full.names=TRUE)
plot(r <- raster(list[1]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.