# Creating a Canopy Height Model (CHM) image from a LAS file on Mac?

Main question: Is there a way of creating a Canopy Height Model from a LAS file using Mac (not wine etc)? I also would like to batch process a lot of LAS files the same way.

I should mention that I have tried PDAL with writers.gdal through docker where I managed to make a DTM and DSM. But then what? Is it possible to create a CHM with PDAL? I saw lidar2dems but I'm not sure it would work on Mac.

Maybe there are more alternatives than PDAL?

• You can use LasTools (I think) rapidlasso.com/2014/10/04/using-lastools-on-mac-os-x-with-wine not being a Mac user I can't verify the text. Is your LAS classified to at least ground/nonground? you need to create a ground raster (class 2,8 and possibly 9) and nonground height raster then subtract the ground from the nonground using QGIS raster calculator (or other package that works on Mac) consider where there is no vegetation or just noise and decide if you want 0 or NoData where the rasters are very similar before processing. – Michael Stimson Mar 15 '17 at 0:25
• Why are you against using wine? Lastools runs fine using wine. More details here: rapidlasso.com/2014/10/04/using-lastools-on-mac-os-x-with-wine. Additionally, here is a lastools article on generating CHMs: rapidlasso.com/2014/11/04/…. If you have serious processing needs, spin up an AWS EC2 instance running Ubuntu using lascanopy. – Aaron Mar 15 '17 at 2:57
• I should have mentioned that I don't have the economy to use rapidlassos license. Therefore that's not really an option for me. – oskarlin Mar 15 '17 at 9:26

In addition to what has been mentioned above, SPDLib is another powerful set of open-source tools for processing LiDAR data (LAS files). It is cross-platform and supports Mac.

The spdinterp program has the capability to generate Canopy Height Models as well as DTMs and DSMs.

1) You can use the the little known Whitebox GAT (Mac version, Download Whitebox Geospatial Analysis Tools), developed for the Java platform (Java Runtime Environment (JRE) version 8.0 or higher installed) and Open Source (GNU General Public License version 3)

2) You can also use

There are other solutions if you know Python or R (lidR package: Compute a digital canopy model (DCM) for example)

I ended up with this solution with PDAL and GDAL:

First I used liblas to create LAS containing only ground points. Then I used PDAL similar to the "Basic Example" but with output_type: max to create a DTM from the terrain LAS and a DSM from the original LAS.

Then just gdal_calc.py with these to elevation models to get a DHM.

gdal_calc.py -A DSM.tif -B DTM.tif --outfile=CHM.tif --calc="A-B" --NoDataValue=0