I don't understand why when rasterizing normalized point clouds (using lidR
, R
environment) with no negative value, I can get raster canopy height model with negative values?
An example based on the sample data from lidR
package:
library(lidR)
LASfile <- system.file("extdata", "Megaplot.laz", package="lidR")
las <- readLAS(LASfile)
nlas <- normalize_height(las,tin())
summary(nlas$Z)
# > summary(nlas$Z) # NO Negative values
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# 0.00 7.78 14.93 13.27 19.32 29.97
If we look at the value of the rasterized CHM, we can find negative values. The phenomenon is less clear with this dataset but with my data, these can be of several meters!
chm <- grid_canopy(nlas, res = 1, pitfree(subcircle = 0.15))
# > chm
# class : RasterLayer
# dimensions : 236, 228, 53808 (nrow, ncol, ncell)
# resolution : 1, 1 (x, y)
# extent : 684766, 684994, 5017772, 5018008 (xmin, xmax, ymin, ymax)
# crs : +proj=utm +zone=17 +datum=NAD83 +units=m +no_defs
# source : memory
# names : Z
# values : -0.0001215559, 28.97837 (min, max)
It also occur with dsmtin() algorithm, which is really similar than the one used for height normalization.
grid_canopy(nlas, res = 1, dsmtin())
# class : RasterLayer
# dimensions : 235, 228, 53580 (nrow, ncol, ncell)
# resolution : 1, 1 (x, y)
# extent : 684766, 684994, 5017773, 5018008 (xmin, xmax, ymin, ymax)
# crs : +proj=utm +zone=17 +datum=NAD83 +units=m +no_defs
# source : memory
# names : Z
# values : -0.0001546422, 29.11114 (min, max)
Could someone explain me these negative values ?