Learn R Programming

uavRst (version 0.5-2)

pc_2D_fdtm: Create a Digital Terrain Model from UAV generated point clouds by minimum altitude sampling (fix resolution of sampling gridsize)

Description

Create a Digital Terrain Model from a high density point cloud as typically derived by an optical UAV retrieval. Due to the poor estimation of ground points a minimum samopling approach is applied. It retrieves on a coarse fixed sampling gridsize the minimum value and interpolates on these samples a surface grid with a higher target resolution. this is a kind of an try and error process and provides fairly good results if the point cloud shows at least some real surface points on a not to coarse grid.

Usage

pc_2D_fdtm(laspcFile = NULL, grassVersion = 1, searchPath = NULL,
  gisdbasePath = NULL, tension = 20, sampleMethod = "min",
  cutExtent = NULL, sampleGridSize = 25, targetGridSize = 0.1,
  splineThresGridSize = 0.5, 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)

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

gisdbasePath

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

tension

numeric. tension of spline interpolation.

sampleMethod

character. sampling method of r.in.lidar Statistic to use for raster values Options: n, min, max, range, sum, mean, stddev, variance, coeff_var, median, percentile, skewness, trimmean Default: mean

cutExtent

clip area

sampleGridSize

numeric, resolution extraction raster

targetGridSize

numeric. the resolution of the target DTM raster

splineThresGridSize

numeric. threshold of minimum gridsize tha is used for splininterpolation if the desired resolution is finer a two step approximation is choosen first step spline interpolation using the treshold gridsize second step bilinear resampling to the desired targetGridSize.

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)

Examples

Run this code
# 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=paste0("lasdata.las"))

# create 2D point cloud DTM
dtm <- pc_2D_fdtm(laspcFile = "lasdata.las",
                gisdbasePath = projRootDir,
                tension = 20 ,
                sampleGridSize = 25,
                targetGridSize = 0.5,
                giLinks = giLinks)
                
mapview::mapview(dtm)                 
                }

# }

Run the code above in your browser using DataLab