# NOT RUN {
# required packages
require(uavRst)
require(link2GI)
# create and check the links to the GI software
giLinks<-uavRst::linkGI(linkItems = c("saga","gdal"))
if (giLinks$saga$exist) {
# get the rgb image, chm and training 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 = tempdir())
polyStat <- poly_stat("chm_3-3_train1",
spdf = "rgb_3-3_train1.shp",
giLinks=giLinks)
raster::plot(polyStat)
}
##+
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab