>  Docs Center  >  Using ENVI  >  Map Forest Density Sample Code
ENVI

Map Forest Density Sample Code

Map Forest Density Sample Code

This sample shows how to process LiDAR data to classify points as vegetation, and then create a vegetation density raster and a canopy height raster. These raster products can be opened for viewing in ENVI.

The install_dir\DataSample\Hemlock_*.laz data is ideal to use with this extension. It is heavily forested and will give the best approximation. These data were made available by the Rochester Institute of Technology via the SHARE 2012 experiment.

Use the sample code to become familiar with extensions. This sample provides information on how to:

  • Prompt for user .las, .laz, .ini, or current project input.
  • Get the classification values for all points and the total number of points in the input file.
  • Determine if the input is classified.
  • Process the input data to generate the DEM and DSM (the DSM will simulate the tree height).
  • Process the data to classify trees and generate a point cloud.
  • Calculate the total point data.
  • Calculate the vegetation density data.
  • Start ENVI.
  • Subtract DEM from DSM to calculate canopy height above terrain.
  • Get the dimensions and DATA_IGNORE_VALUE from the DEM file.
  • Generate the tree height and density rasters.
  • Display the tree height and density rasters.

Tip: When displayed in ENVI, the forest density raster can be colored to better illustrate variance in the density. Right-click Density.dat in the Layer Manager and select Change Color Table > Rainbow.

View the Sample Code


  1. Start ENVI LiDAR.
  2. In the Toolbox, select Samples.
  3. Right-click Forest Density and select Debug.

Note: If the extension is not visible in the Toolbox, verify you have a full IDL license.

Run the Sample Code


Use one of the following to run the sample code:

  • On the IDL workbench toolbar, click Compile, then click Run.
  • In ENVI LiDAR double-click the Forest Density extension in the Toolbox.

Note: Depending on your user account privileges, you may not be able to save changes to the sample extensions. Refer to Deploy Extensions for information on copying the samples to a user-writeable location.



© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us