Wrapper function which paste the OTB command list into a system call compatible string and execute this command.

runOTB(otbCmdList = NULL, gili = NULL, retRaster = TRUE, quiet = TRUE)

Arguments

otbCmdList

the OTB algorithm parameter list

gili

optional gis linkage as done by `linkOTB()`

retRaster

boolean if TRUE a raster stack is returned

quiet

boolean switch for supressing messages default is TRUE

Examples

if (FALSE) { require(link2GI) require(raster) require(listviewer) ## link to OTB otbLink<-link2GI::linkOTB() if (otblink$exist) { projRootDir<-tempdir() data('rgb', package = 'link2GI') raster::plotRGB(rgb) r<-raster::writeRaster(rgb, filename=file.path(projRootDir,"test.tif"), format="GTiff", overwrite=TRUE) ## for the example we use the Statistic Extraction, algoKeyword<- "LocalStatisticExtraction" ## extract the command list for the choosen algorithm cmd<-parseOTBFunction(algo = algoKeyword, gili = otbLink) ## get help using the convenient listviewer listviewer::jsonedit(cmd$help) ## define the mandantory arguments all other will be default cmd$input <- file.path(tempdir(),"test.tif") cmd$out <- file.path(tempdir(),"test_otb_stat.tif") cmd$radius <- 7 ## run algorithm retStack<-runOTB(cmd,gili = otbLink) ## plot raster raster::plot(retStack) } }