View source: R/hydro-delineate_lakes.R
delineate_lakes | R Documentation |
Individual surfacic waterbodies segmentation to find the contour of the waterbodies (lakes, rivers).
This function is designed to be used on raw point clouds with 1 point per square meter.
Point-clouds must be loaded with option filter = "-thin_with_grid 1"
.
delineate_lakes( las, tol = 1/1000, tol2 = c(1/30 * tol, 2 * tol), trim = 1000, p = 0.5, res = 5, th1 = 25, th2 = 6, k = 10 )
las |
A LAS or LAScatalog object. |
tol |
numeric. Positive value. The method tracks the flat regions. This parameter gives the tolerance to the deviation to 'perfectly flat' region. 0 means 0 tolerance so meighboring points must be perfectly aligned exactly on a. A value ranging between 1/10000 and 1/100 might be good. This parameter is of major importance and greatly affect the output. |
tol2 |
numeric. Positive values. To speed-up the computation a raster-based pre-processing
is made. This parameter has the same meaning than |
trim |
numeric. Bodies with an area smaller than this value are removed. This param reduce oversegmentation of small bodies than may be mistaken with a waterbody |
p |
numeric. Value between 0 and 1. During the pre-processing raster-based step, cells that have a probability below 'p' to be a lake are not considered in subsequent processing (see references). This parameter is not of major importance |
res |
numeric. Resolution of the raster use in the pre-processing steps. This parameter is not of major importance |
th1, th2, k |
Param of the function shp_hplane that is used internally. Notice that
|
See the reference for more details. The methods relies on two steps. A raster-based pre-processing step that segments roughtly the waterbodies and a vector-based step that fine accuraly the contours of the lakes. The raster-based step is made of two steps: (a) a very conservative estimation in which the expected output is a raster that contains all the waterbodies without false positive but the shape of the waterbodies might be very poorly estimated and (b) an permissive step in which the shapes of the waterbodies are almost correct but with potential false positive. The two steps are then merged internally in a single accurate raster. Using this raster to speed-up the computation of the vector-based step, the method computes a very accurate contour of the waterbodies.
A SpatialPolygons.
User can apply the function with tol = NULL
to return only the raster-based step output.
Also the parameter tol2
can be only 1 numbers to return only one estimation. tol2
is
very important and the users must ensure than the conservative step only retains true positive (using
a very conservative value such as 1/10000) and the permissive step have a good estimation of the
shape even at the cost of many false positives that are anyway removed later using the conservative
step.
#'
# Run only the raster-based conservative step (output is a RasterLayer) r <- delineate_lakes(las, tol = NULL, tol2 = 1/30000) # Run only the raster-based permissive step (output is a RasterLayer) r <- delineate_lakes(las, tol = NULL, tol2 = 2/1000) # Run both raster-based steps (output is a RasterStack) r <- delineate_lakes(las, tol = NULL, tol2 = c(1/30000, 2/1000))
Supported processing options for a LAScatalog
. For more details see the
LAScatalog engine documentation:
chunk size: How much data is loaded at once.
chunk buffer: The buffer size is estimated internally
chunk alignment: Align the processed clusters.
progress: Displays a progress estimate.
output_files: Return the output in R or write each cluster's output in a file. Supported
templates are XLEFT
, XRIGHT
, YBOTTOM
, YTOP
, XCENTER
, YCENTER
ID
and, if chunk size is equal to 0 (processing by file), ORIGINALFILENAME
.
select: 'xyz' are loaded by default.
filter: "-thin_with_grid 1" is the default.
Roussel Jean-Romain, Segmentation of water bodies from ALS data without spectral information (in prep.)
LASfile <- system.file("extdata", "Topography.laz", package="lidR") las <- readLAS(LASfile, filter = "-thin_with_grid 1") lake <- delineate_lakes(las, trim = 700) plot(header(las)) plot(lake, add = TRUE, col = "cornflowerblue") ## Not run: mapview::mapview(lake) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.