# NOT RUN {
require(uavRst)
require(link2GI)
# project folder
projRootDir<-tempdir()
# create subfolders please mind that 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_")
# overide trailing backslash issue
setwd(path_run)
# get the data
utils::download.file("https://github.com/gisma/gismaData/raw/master/uavRst/data/crowns.zip",
paste0(path_run,"crowns.zip"))
unzip(zipfile = paste0(path_run,"crowns.zip"), exdir =".")
raster::plot(raster::shapefile(paste0(path_run,"polyStat.shp")))
# start postclassification of segements
tree_crowns <- crown_filter(crownFn = paste0(path_run,"polyStat.shp"),
minTreeAlt = 3,
minCrownArea = 20,
maxCrownArea = 50,
minTreeAltParam = "chmQ20" )
# visualize it
raster::plot(tree_crowns[[2]])
##+
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab