# NOT RUN {
##- required packages
require(uavRst)
require(link2GI)
##- project folder
projRootDir<-tempdir()
##-create subfolders pls notice the pathes are exported as global variables
paths<-link2GI::initProj(projRootDir = projRootDir,
projFolders = c("data/","data/ref/","output/","run/","las/"),
global = TRUE,
path_prefix = "path_")
unlink(file.path(tempdir(),"*"), force = TRUE)
##- get the tutorial data
utils::download.file("https://github.com/gisma/gismaData/raw/master/uavRst/data/ffs.zip",
file.path(tempdir(),"ffs.zip"))
unzip(zipfile = file.path(tempdir(),"ffs.zip"), exdir = tempdir())
##- assign tutorial data
imageFile <- file.path(tempdir(),"predict.tif")
load(file.path(tempdir(),"tutorialbandNames.RData"))
tutorialModel<-readRDS(file = file.path(tempdir(),"tutorialmodel.rds"))
##- start the prediction taking the non optimized model
##- please note the output is saved in the subdirectory path_output
prediction<-predict_rgb(imageFiles=imageFile,
model = tutorialModel[[1]],
bandNames = bandNames)
##- visualise the classification
raster::plot(prediction)
##+
# }
Run the code above in your browser using DataLab