poly_stat: Calculate descriptive statistics of raster as segmented by...

Description Usage Arguments Value Author(s) Examples

View source: R/tb_bluedjinn.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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

Value

data frame containing the descriptive statistic of all corresponding raster* objects for each given polygon

Author(s)

Chris Reudenbach

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## 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)
}
##+
## End(Not run)

uavRst documentation built on Dec. 30, 2019, 5:06 p.m.