Description Usage Arguments Value Note Author(s) Examples
Calculates local statistics for a given kernel size
1 2 3 4 5 6 7 8 9 10 11 |
input |
of GeoTiff containing 1 ore more gray value bands |
out |
string pattern vor individual naming of the output file(s) |
ram |
reserved memory in MB |
radius |
computational window in pixel |
channel |
sequence of bands to be processed |
retRaster |
boolean if TRUE a raster stack is returned |
outDir |
output Directory |
verbose |
switch for system messages default is FALSE |
otbLinks |
list. of GI tools cli pathes |
raster* object
the otb is used for the calculation of the statistics. Please provide a GeoTiff file
Chris Reudenbach
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 | ## Not run:
# load libraries
require(uavRst)
require(link2GI)
require(listviewer)
setwd(tempdir())
# check if OTB exists
otbLinks <- link2GI::linkOTB()
if (otbLinks$exist) {
data("rgb")
raster::plotRGB(rgb)
fn<-file.path(tempdir(),"rgb.tif")
raster::writeRaster(rgb,
filename=fn,
format="GTiff",
overwrite=TRUE)
# get help
cmd<-link2GI::parseOTBFunction(algo = "LocalStatisticExtraction",gili=otbLinks)
listviewer::jsonedit(cmd$help)
# calculate statistics
result<- otb_stat(input=fn,
radius=5,
retRaster = TRUE,
channel = 1,
otbLinks = otbLinks)
# plot the results :
raster::plot(result[[1]])
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.