uavRst (version 0.5-2)

poly_stat: Calculate descriptive statistics of raster as segemented by polygons

Description

calculate statitiscs of polygon based raster extraction. Returns a spatialpolygon dataframe containing decriptive statistics

Usage

poly_stat(rasternames = NULL, spdf = NULL, count = 1, min = 1,
  max = 1, sum = 1, range = 1, mean = 1, var = 1, stddev = 1,
  quantile = 10, parallel = 1,
  proj = "+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
  path_run = tempdir(), giLinks = NULL)

Arguments

rasternames

vector of raster* objects default is NULL

spdf

spatial polygon dataframe default is NULL

count

0 1 switch

min

0 1 switch

max

0 1 switch

sum

0 1 switch

range

0 1 switch

mean

0 1 switch

var

0 1 switch

stddev

0 1 switch

quantile

number of quantile

parallel

run it parallel default is 1

proj

projection string

path_run

run time folder for all kind of calculations, by default tempdir()

giLinks

list of GI tools cli pathes, default is NULL

Examples

Run this code
# NOT RUN {
# required packages
require(uavRst)
require(link2GI)

# create and check the links to the GI software
giLinks<-uavRst::linkAll(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