I'm doing forestry analysis of some point cloud data and I have used segmentation procedures (i.e. watershed algorithm, etc..) to delineate the crown boundaries of individual trees in 2D.

The vector file that represents the tree crown boundaries has a 'Tree ID' field with unique values for each tree.

I want to use the original point cloud and the vectors as inputs and find the coordinates (x,y,z) of the local maxima (i.e. the tree tops) for each tree.

I'm aware of the option to rasterize the point cloud and compute the maxima in 2D using traditional zonal statistics, but want to test the departure between the points as located this way versus locating them directly from the cloud within the polygons.

Solutions in R, QGIS or Python would be preferred, though I also have access to ArcGIS, Matlab, and ENVI.


I found a solution using FUSION and PDAL.

First, I used @andre silva's answer from this post to clip my point clouds using the shapefiles so that I created new point clouds for each of my trees and stored them together in a new folder. Clipping LAS data using shapefile polygons and open source software?

The code in FUSION looks like this, where the flag "shape" coerces the names of the outputs to include my "tree ID" variable:

polyclipdata /multifile /shape:1,* path\to\shapefile.shp path\to\clipped_outputs.las path\to\las_file.las

Next, I created a PDAL pipeline to read in all of the .las files individually and find the points with maximum "Z" values for each. The files are merged and output as both a .las point cloud and an ESRI shapefile with the treetop points.

"type" : "writers.las",
"forward": "all",
"filename" : "crown_maxima.las"

This took me way longer than it should have so I hope it will save someone else some time!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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