QGIS fun with LIDAR data
After fooling around with DEM data yesterday my buddy Mike did some nice work for me and gave me LIDAR data. Nnot raw LIDAR data but rather processed data; gridded DEMs of various sorts. The raw data comes from an August 2018 LIDAR survey of my area. I’m no expert at LIDAR at all but I learned enough to be dangerous, so here it is.

The raw data comes in LAZ files, which are basically point readings; a laser reflected off of something at that specific XYZ. Mike’s Makefile munges that through las2las, las2ogr, and ogr2ogr to get it into a specific reprojected GeoPackage file. Then gdal_grid does the real magic of looking at all those random points in XY space and mapping them to a uniform XY grid suitable for a raster DEM. From there you can use normal DEM tools.
The neat thing is LIDAR gives you multiple Z values for a specific X, Y coordinates. Ie: that there were reflections for a particular spot at, say, both 2103.37 meters and 2122.93 meters. What could that mean? In a word, trees. Sometimes the laser penetrates the leaves and reflects off the ground, sometimes it bounces off the leaves. That sounds noisy, but it’s super useful.
The trick is if you take the minimum elevation at every X, Y then you get a DEM of something like ground level. Not exactly; buildings will show higher, so will the middle of a tree trunk. But it’s pretty close. Similarly if you take the maximum then you get the height of the tree at that spot. And if you take the difference max-min you get the tree height. More or less.
So that’s what’s shown on my map above; tree heights from 0m to 25m rendered white to green. Isn’t that neat? The choice of 25m is important; too low and all the trees look the same, too high and you can’t see all of the forest for trying to emphasize the one tree.
A quick Google Search suggests it’s possible to write a tree classifier that looks solely at LIDAR data and knowledge about the biome and estimates a tree inventory by species. Helps if you can compare summer and winter images.
I tried also using a discrete color scale to color the tree height in categories. Flat ground (white), low brush (brown), small trees (light green), and big trees (dark green). It sort of works, I think the data picture below is fairly accurate, but it’s also pretty hard to read. Also it doesn’t tell me anything about what I really need to know, which is where there’s brush underneath trees.

I also experimented with using the LIDAR data to make contours. Honestly the result isn’t better than what I got with the 1/3 a.s. DEM file. It’s much noisier and the extra accuracy doesn’t much help. LIDAR contours in red, DEM contours in grey. I suspect if you really want to get a proper elevation map from LIDAR data alone you need to work harder at smoothing the data and discarding errors.
