X
3690

How to generate specific products using the ENVI Lidar API

When you create products in the ENVI Lidar GUI (user interface), you will open the Project Properties to set the products that you want to be created.  Here you select which products will or will not be created and some are set to be generated by default while others are not.  These same defaults apply when using the API (programming interface). 

The products that are generated by default are documented in the ENVI Lidar help and include:

BUILDINGS_GENERATE,TREES_GENERATE, ORTHOPHOTO_GENERATE, DEM_GENERATE, and POWERLINES_GENERATE

For example, the ENVI Lidar help for E3DProductionParameters shows that buildings are generated by default using a (default) Boolean value of 1 (Generate):

BUILDINGS_GENERATE

A boolean value to generate buildings products as follows:

  • 0: Do not generate
  • 1: Generate (default)

While DEM Contours are not generated by default using a (default) Boolean value of 0 (Do not generate):

DEM_CONTOURS_GENERATE

A boolean value to generate DEM contours as follows:

  • 0: Do not generate (default)
  • 1: Generate

In this case, if you did not want to generate Building vectors but wanted to generate DEM contours you would need to set the Boolean value to 0 for BUILDINGS_GENERATE and 1 for DEM_CONTOURS_GENERATE, respectively. 

If you wish to generate a specific product and not others, then you will need to set these parameters appropriately in your script.  In the following example, only a DEM and DSM will be generated, so the other default products must be set to "Do not generate".

PRO dem_dsm_gen

  e3de = e3de(/headless)
  lidar = e3de.openlidar('C:\Temp\DataSample.las')
  prodParams = E3De.GetProductionParameters(lidar)
  prodParams.DSM_GENERATE = 1
  prodParams.DEM_GENERATE = 1
  prodParams.DEM_CONTOURS_GENERATE = 0
  prodParams.DEM_TIN_GENERATE = 0
  prodParams.VIEWER_DATABASE_GENERATE = 0
  prodParams.FILTERED_POINTCLOUD_GENERATE = 0
  prodParams.TREES_GENERATE = 0
  prodParams.POWERLINES_GENERATE = 0
  prodParams.ORTHOPHOTO_GENERATE = 0
  prodParams.BUILDINGS_GENERATE = 0
 
  ;Save the prodParams info
  prodParams.Save
 
  ;Generate products
  E3De.GenerateProducts, lidar
 
  E3De.Close

END