I created a canopy height model (from lidar data) using lidR package and wanted to check it on Arcmap. I see there are minus values on canopy height models like -0.246219, -0.0302621. How can I deal with minus values in my canopy height model?


1 Answer 1


It is always advisable to filter your points prior to generating a canopy height model. The following is a processing pipeline that filters normalized points.

Pipeline Overview

  1. Read point cloud data
  2. Normalize point cloud so that ground = 0
  3. Filter points, keeping points where Z >= 0m & Z <= 40m
  4. Generate the canopy height model

enter image description here


indata <- '/path/to/your/lidar_data.laz'
las <- readLAS(indata)

# Normalize point cloud data
normalized_las <- lasnormalize(las, tin())

# Keep points where Z >= 0 & Z <= 40 
filtered <- lasfilter(normalized_las, Z >= 0 & Z <= 40)

# Visualize difference between filtered and unfiltered points
boxplot(normalized_las@data$Z, ylim = c(-10,55), ylab = "Height (m)", main = "Before Filtering")
boxplot(filtered@data$Z, ylim = c(-10,55), ylab = "Height (m)", main = "After Filtering")
hist(normalized_las@data$Z, xlim=c(-2,55), xlab = "Height (m)", main = "Before Filtering")
hist(filtered@data$Z, xlim=c(-2,55), xlab = "Height (m)", main = "After Filtering")

#Generate canopy height model
chm <- grid_canopy(filtered, 0.5, p2r(0.2))
  • 1
    I do not necessarily agree with you. If you remove point below 2 you will have empty areas in your CHM for canopy gaps instead of zeros or values close to 0. Worst with a tin-based method you could fill the gap with irrelevant values. It can makes sense, or not depending on the method used and depending on what you want to do with your CHM.
    – JRR
    Dec 7, 2019 at 22:39
  • Thanks @JRR, I have edited the answer based on your comment.
    – Aaron
    Dec 7, 2019 at 23:11
  • Thanks a lot for your answers. I used the pit-free algorithm and used chm = grid_canopy(filtered, res=0.5, pitfree(c(0,2,5,10,15), c(0, 1.5))) at the final step. But I have too much triangles on my chm model now :( Dec 7, 2019 at 23:22
  • @bcresearcher Triangles?
    – Aaron
    Dec 7, 2019 at 23:24
  • 1
    @bcresearcher Open a new question with images and reproducible code.
    – JRR
    Dec 8, 2019 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.