otbCmdList: the correctly populated OTB algorithm parameter list
gili: optional list of available OTB installations, if not specified, linkOTB() is called to automatically try to find a valid OTB installation
retRaster: boolean if TRUE a raster stack is returned default is FALSE
retCommand: boolean if TRUE only the OTB API command is returned default is FALSE
quiet: boolean if TRUE suppressing messages default is TRUE
Details
#' Please NOTE: You must check the help to identify the correct input file argument (inputinorinput_il).
Examples
## Not run:require(link2GI)require(terra)require(listviewer)## link to OTBotblink<-link2GI::linkOTB()if(otblink$exist){ root_folder<-tempdir() fn <- system.file('ex/elev.tif', package ='terra')## for an image output example we use the Statistic Extraction, algoKeyword<-'LocalStatisticExtraction'## extract the command list for the choosen algorithm cmd<-parseOTBFunction(algo = algoKeyword, gili = otblink)## Please NOTE:## You must check the help to identify the correct argument codewort ($input_in or $input_il)listviewer::jsonedit(cmd$help)## define the mandatory arguments all other will be defaultcmd$input_in <- fn
cmd$out <- file.path(tempdir(),'test_otb_stat.tif')cmd$radius <-7## run algorithmretStack<-runOTB(cmd,gili = otblink)## plot imageterra::plot(retStack)## for a data output example we use the algoKeyword<-'ComputeImagesStatistics'## extract the command list for the chosen algorithm cmd<-parseOTBFunction(algo = algoKeyword, gili = otblink)## get help using the convenient listviewerlistviewer::jsonedit(cmd$help)## define the mandatory arguments all other will be defaultcmd$input_il <- file.path(tempdir(),'test.tif')cmd$ram <-4096cmd$out.xml <- file.path(tempdir(),'test_otb_stat.xml')cmd$progress <-1## run algorithmret <- runOTB(cmd,gili = otblink, quiet = F)## as vectorprint(ret)## as xmlXML::xmlParse(cmd$out)}## End(Not run)