# NOT RUN {
# }
# NOT RUN {
require(uavRst)
require(link2GI)
# create and check the links to the GI software
sagaLinks<-link2GI::linkSAGA()
gdalLinks<-link2GI::linkGDAL()
otbLinks<-link2GI::linkOTB()
##- create and set folders
##- please mind that the pathes are exported as global variables
paths<-link2GI::initProj(projRootDir = tempdir(),
projFolders = c("data/","data/ref/","output/","run/","las/"),
global = TRUE,
path_prefix = "path_")
##- clean runtime folder
unlink(file.path(tempdir(),"*"), force = TRUE)
##- get the tutorial data
url<-"https://github.com/gisma/gismaData/raw/master/uavRst/data/tutorial_data.zip"
utils::download.file(url,
file.path(tempdir(),"tutorial_data.zip"))
unzip(zipfile = file.path(tempdir(),"tutorial_data.zip"),
exdir = R.utils::getAbsolutePath(path_run))
##- calculate some synthetic channels from the RGB image and the canopy height model
##- then extract the from the corresponding training geometries the data values aka trainingdata
trainDF <- calc_ext(calculateBands = TRUE,
extractTrain = TRUE,
suffixTrainGeom = "",
patternIdx = "index",
patternImgFiles = "rgb" ,
patterndemFiles = "chm",
prefixRun = "tutorial",
prefixTrainImg = "",
rgbi = TRUE,
indices = c("TGI","CI"),
channels = c("red"),
rgbTrans = TRUE,
hara = TRUE,
haraType = c("simple"),
stat = TRUE,
edge = TRUE,
morpho = TRUE,
pardem = TRUE,
#demType = c("slope", "MTPI"),
kernel = 3,
currentDataFolder = path_run,
currentIdxFolder = path_run,
sagaLinks = sagaLinks,
gdalLinks = gdalLinks,
otbLinks =otbLinks)
##- show the result
head(trainDF)
# use ffs_train as next step for rf classification issues
# }
Run the code above in your browser using DataLab