crown_filter: basic filtering of crown polygons using altitude, area and...

Description Usage Arguments Author(s) Examples

View source: R/fa_crownfilter.R

Description

applies basic filtering of crown polygons using altitude, area and other optional thresholds. crown_filter basically returns SPDF with the crown polygons and all calculated parameters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
crown_filter(
  crownFn,
  minTreeAlt = 10,
  minCrownArea = 5,
  maxCrownArea = 100,
  minTreeAltParam = "chm_Q50",
  crownSTDW = NULL,
  opt = NULL,
  TAopt = NULL,
  proj4string = "+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs"
)

Arguments

crownFn

filname of OGR compliant vector file

minTreeAlt

minimum height in meter that will be regarded as tree

minCrownArea

minimum area of crowns that is accepted

maxCrownArea

maximum area of crowns that is accepted

minTreeAltParam

parameter that is used for filtering MinTreeAlt, default is Median "chmQ50"

crownSTDW

parameter that optionally filters for the STDV of the crown altitudes, default is NULL

opt

threshold value for optional filter, default is NULL

TAopt

optional parameter that might be used for filtering, default is NULL

proj4string

proj4 string

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
23
24
25
26
27
28
29
30
31
32
## 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

# get the data
utils::download.file("https://github.com/gisma/gismaData/raw/master/uavRst/data/crowns.zip",
                       file.path(tempdir(),"crowns.zip"))
unzip(zipfile = file.path(tempdir(),"crowns.zip"), exdir =".")

 raster::plot(raster::shapefile(file.path(tempdir(),"polyStat.shp")))

# start postclassification of segements
tree_crowns <- crown_filter(crownFn =  file.path(tempdir(),"polyStat.shp"),
                             minTreeAlt = 3,
                             minCrownArea = 20,
                             maxCrownArea = 50,
                             minTreeAltParam = "chmQ20" )
# visualize it
raster::plot(tree_crowns[[2]])
##+
## End(Not run)

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