LiVoxGen: A C++ Program to Voxelize LiDAR Data

A 551Kb PDF of this article as it appeared in the magazine complete with images is available by clicking HERE

LiVoxGen is a C++ program that processes LiDAR data in the form of LAS files and creates voxels (volumetric pixels) of user-selected dimensions to aid in the analysis of the LiDAR data. LiVoxGen’s git repository may be found on GitHub. The purpose of this program is to better understand forest composition.

The input files in LiVoxGen, LAS files, contain data from LiDAR point clouds. LiVoxGen takes in a LAS file along with various metric files that correspond to that LAS file and parses the data in two ways:

Voxelization: With dimensions chosen by the user, LiVoxGen splits the bounded LAS file into volumetric pixels (voxels) and outputs a file with the center coordinates of each voxel and the points within each voxel. We will refer to this file as a histogram flat file.

Determination of Metrics for Voxel Column Centroids: For each column of voxels, LiVoxGen outputs a file including the column centroid’s xy-coordinates along with corresponding metrics for that coordinate (e.g. densities, percentiles, tree cover, etc.). We will refer to this file as a LiDAR metric flat file.

In order to run LiVoxGen, the user must have the required libraries installed. These libraries each serve a different function in the creation and execution of LiVoxGen: libLAS:

libLAS is a C/C++ library that reads and writes LAS files.

libTIFF: libTIFF is a library for reading and writing Tag Image File Format (TIFF) files. LiVoxGen requires libTIFF to create the LiDAR metrics flat files.

GDAL: GDAL is "a translator library for raster and vector geospatial data formats." In this program, GDAL reads the TIFF files that provide metrics for the LiDAR data.

Boost: Boost allows processing of an entire directory of LAS or metric files at once.

kdtree: kdtree is a simple C library that creates and iterates through kd-trees. kd-trees are k-dimensional binary search trees. In this case, our kd-tree operates in three dimensions corresponding to the x, y, and z values for each point in the LAS file.

Custom Classes
In addition to the methods from the open source libraries, custom classes build LiVoxGen and together form the VoxData objects eventually written to the output text file of the program.

Point: The simple Point class contains the x, y, and z coordinates for a point.

Voxel: The Voxel class contains the x, y, and z coordinates for the center of the voxel along with a vector of the points within the voxel This class contains a function that takes in a point and returns whether or not that point is within the voxel. The kdtree library determines if the point is within a sphere about the voxel centroid, and another Voxel class function trims that sphere to a rectangular prism.

VoxCol: The VoxCol class simply contains the x and y center coordinates for a given voxel column and a vector of voxels (Voxel objects) that are within that column. VoxData:

VoxData is a class that summarizes the voxel information for a given LAS file. It includes a vector of all the voxel columns (VoxCol objects), the number of points in all the voxels, the number of voxel columns, and the number of voxels in each voxel column. VoxData also includes methods to read and write files.

vgpar: vgpar requires a text document parameter file of relevant information for the LIVoxGen program. vgpar allows the user to customize how LiVoxGen runs in terms of voxel size, file locations, point filtering, etc.

Analysis of Output
The information from the output files from LiVoxGen may be used in different ways. First, the histogram flat files can be imported into a statistical programming language and analyzed. As an example, a heat map showing forest densities (based on voxels point counts) can be generated by the R package VoxGenR (included in the GitHub repository for LiVoxGen).

In addition to analyzing forest composition with voxels, a user can gain further insights into fire data with the LiDAR metric flat files. If the user has raster data from a fire in the form of a shapefile or vector file, he or she can create a simple R script that extracts the data from the raster for each voxel column centroid. The extracted data can then be compared to the lidar metrics for each centroid, and patterns in data may emerge as we observed in comparing the years since a centroid burned with the centroid’s fraction of first returns intercepted by a tree ("tree_fcover").

The output files of LiVoxGen (histogram flat files and lidar metric files) provide the user with the flexibility needed to explore LiDAR data in a new form. By allowing users to quickly estimate forest densities, voxels provide a new avenue into examining LAS files. My goals for LiVoxGen include improving its efficiency and discovering further applications for its histogram flat files. Further information–including Quality Assurance–about LiVoxGen can be found at its GitHub repository in the "Documentation" directory or its project website.

LiVoxGen was created under the guidance of Dr. Andrew Finley of the Michigan State University Forestry Department.

Bruce Cook, Principal Investigator of the NASA G-LiHT project, requested this program as a means to process airborne LiDAR data for further scientific analysis.

Megan Kress is a research assistant at Michigan State University. She is pursuing Master’s degrees in Forestry and Computer Science.

A 551Kb PDF of this article as it appeared in the magazine complete with images is available by clicking HERE