Remove the topography from a point cloud

Subtract digital terrain model (DTM) from LiDAR point cloud to create a dataset normalized with the ground at 0. The DTM can originate from an external file or can be computed by the user. It can also be computed on-the-fly. In this case the algorithm does not use rasterized data and each point is interpolated. There is no inaccuracy due to the discretization of the terrain and the resolution of the terrain is virtually infinite. How well the edges of the dataset are interpolated depends on the interpolation method used. Thus, a buffer around the region of interest is always recommended to avoid edge effects. The attribute Z of the returned LAS object is the normalized elevation. A new attribute 'Zref' records the former elevation values, which enables the use of lasunormalize to restore original point elevations.

lasnormalize(las, algorithm, na.rm = FALSE)


# S4 method for LAS,RasterLayer -(e1, e2)

# S4 method for LAS,`function` -(e1, e2)


An object of class LAS or LAScatalog.


a spatial interpolation function. lidR have tin, kriging, knnidw or a RasterLayer representing a digital terrain model (can be computed with grid_terrain)


logical. When using a RasterLayer as DTM, by defaut the function fails if a point fall in an empty pixel because a Z elevation cannot be NA. If na.rm = TRUE points with an elvation of NA are filtered. Becareful this creates a copy of the point cloud.


a LAS object


RasterLayer representing a digital terrain model (can be computed with grid_terrain) or a spatial interpolation function. lidR has tin, kriging, and knnidw.


If the input is a LAS object, return a LAS object. If the input is a LAScatalog, returns a LAScatalog.

Working with a LAScatalog

This section appears in each function that supports a LAScatalog as input.

In lidR when the input of a function is a LAScatalog the function uses the LAScatalog processing engine. The user can modify the engine options using the available options. A careful reading of the engine documentation is recommended before processing LAScatalogs. Each lidR function should come with a section that documents the supported engine options.

The LAScatalog engine supports .lax files that significantly improve the computation speed of spatial queries using a spatial index. Users should really take advantage a .lax files, but this is not mandatory.

Supported processing options

Supported processing options for a LAScatalog (in bold). For more details see the LAScatalog engine documentation:

  • chunk size: How much data is loaded at once.

  • chunk buffer*: Mandatory to get a continuous output without edge effects. The buffer is always removed once processed and will never be returned either in R or in files.

  • chunk alignment: Align the processed chunks.

  • progress: Displays a progression estimation.

  • output_files*: Mandatory because the output is likely to be too big to be returned in R and needs to be written in las/laz files. Supported templates are {XLEFT}, {XRIGHT}, {YBOTTOM}, {YTOP}, {XCENTER}, {YCENTER} {ID} and, if chunk size is equal to 0 (processing by file), {ORIGINALFILENAME}.

  • select: The function will write files equivalent to the original ones. Thus select = "*" and cannot be changed.

  • filter: Read only points of interest.

See Also

raster grid_terrain

  • lasnormalize
  • lasunnormalize
  • -,LAS,RasterLayer-method
  • -,LAS,function-method
LASfile <- system.file("extdata", "Topography.laz", package="lidR")
las <- readLAS(LASfile)


# First option: use a RasterLayer as DTM
# =======================================================

dtm <- grid_terrain(las, 1, kriging(k = 10L))
las <- lasnormalize(las, dtm)


# restore original elevations
las <- lasunnormalize(las)

# operator - can be used. This is equivalent to the previous
las <- las - dtm

# restore original elevations
las <- lasunnormalize(las)

# Second option: interpolate each point (no discretization)
# =========================================================

las <- lasnormalize(las, tin())

# operator - can be used. This is equivalent to the previous
las <- lasunnormalize(las)
las <- las - tin()

# }
# All the following syntaxes are correct
las <- lasnormalize(las, knnidw())
las <- lasnormalize(las, knnidw(k = 8, p = 2))
las <- las - knnidw()
las <- las - knnidw(k = 8)
las <- lasnormalize(las, kriging())
las <- las - kriging(k = 8)
# }
# }
Documentation reproduced from package lidR, version 2.1.0, License: GPL-3

Community examples

Looks like there are no examples yet.