# NOT RUN {
##- required packages
require(uavRst)
##- project root folder
setwd(tempdir())
##- get the rgb image, chm and training data
utils::download.file("https://github.com/gisma/gismaData/raw/master/uavRst/data/tutorial.zip",
"tutorial_data.zip")
unzip(zipfile = "tutorial_data.zip" ,
exdir = ".")
# read data
position <- raster::shapefile("position.shp")
imageFiles <-Sys.glob(paths = paste0("rgb*","tif"))
imageTrainStack<-lapply(imageFiles, FUN=raster::stack)
## get counts
df1<-get_counts(position = position,
ids = c(100,200),
imageFiles = imageFiles,
outPrefix = "",
ext = ".tif",
path = tempdir())
head(df1)
##+
# }
Run the code above in your browser using DataLab