pc_2D_dsm: Create a Digital Terrain Model from UAV generated point...

Description Usage Arguments Value Author(s) Examples

View source: R/rs_pc_2D_dsm.R

Description

Create a Digital Surface Model from a high density point cloud as typically derived by an optical UAV retrieval. It simply samples the maximum or whatever values of a given target grid size and fills the no data holes if so.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
pc_2D_dsm(
  laspcFile = NULL,
  gisdbasePath = NULL,
  grassVersion = 1,
  searchPath = NULL,
  sampleMethod = "max",
  threshold = 20,
  cutExtent = NULL,
  targetGridSize = 0.25,
  projFolder = NULL,
  proj4 = "+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs",
  giLinks = NULL,
  verbose = FALSE
)

Arguments

laspcFile

character. default is NULL path to the laz/las file(s)

gisdbasePath

character. default is NULL root directory of the project. NOTE the function creates two subfolder named run and output

grassVersion

numeric. version of GRASS as derived by findGRASS() default is 1 (=oldest/only version) please note GRASS version later than 7.4 is not working with r.inlidar

searchPath

path to look for grass

sampleMethod

sampling method for point aggregation

threshold

numeric. percentile threshold

cutExtent

clip area

targetGridSize

numeric. the resolution of the target DTM raster

projFolder

subfolders that will be created/linked for R related GRASS processing

proj4

character. valid proj4 string that should be assumingly the correct one

giLinks

list of link2GI cli pathes, default is NULL

verbose

to be quiet (1)

Value

raster* object

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
33
## Not run: 
require(uavRst)
require(link2GI)

# create and check the links to the GI software
giLinks<-list()
giLinks$grass<-link2GI::linkGRASS7(returnPaths = TRUE)
if (giLinks$grass$exist) {

# proj subfolders
projRootDir<-tempdir()
unlink(paste0(projRootDir,"*"), force = TRUE)
paths<-link2GI::initProj(projRootDir = projRootDir,
                         projFolders = c("data/","data/ref/","output/","run/","las/"),
                         global = TRUE,
                         path_prefix = "path_")
# get some colors
pal = mapview::mapviewPalette("mapviewTopoColors")

# get the data
utils::download.file(url="https://github.com/gisma/gismaData/raw/master/uavRst/data/lidar.las",
destfile="lasdata.las")

# create 2D pointcloud DSM
dsm <- pc_2D_dsm(laspcFile = "lasdata.las",
                gisdbasePath = projRootDir,
                sampleMethod = "max",
                targetGridSize = 0.5,
                giLinks = giLinks)
                }
 raster::plot(dsm)

## End(Not run)

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