X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 26 Jan 2016 02:24 PM by  anon
Batch automation processing of .las
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
26 Jan 2016 02:24 PM
    Hi, I'm attempting to Batch process LAS tiles through Envi Lidar. I can successfully run Envi Lidar and process Ortho, DEM, DSM, Trees, Power Lines and Contours. Is it possible to run this script automatically for every .las file in a certain directory? Thanks, Elton G.

    MariM



    Veteran Member


    Posts:2396
    Veteran Member


    --
    27 Jan 2016 09:42 AM
    You can use the API routine discussed in the ENVI 5.3 help for point clouds. For example: http://www.exelisvis.com/docs/envipoi... To process a folder of files, you can use a Foreach loop: http://www.exelisvis.com/docs/FOREACH...

    Deleted User



    New Member


    Posts:
    New Member


    --
    27 Jan 2016 07:18 PM
    Hi Mari, Thanks so much for your reply. I have first attempted to run the script on a single file, but it returns the following error: IDL> untitled_2 % End of file encountered before end of program. At: C:\Users\elton\AppData\Local\Temp\untitled_2.pro, Line 36 % 1 Compilation error(s) in module $MAIN$. % Attempt to call undefined procedure: 'UNTITLED_2'. % Execution halted at: $MAIN$ 1 C:\Users\elton\AppData\Local\Temp\untitled_2.pro IDL> This is the script that I attempted to run: ; Create a headless instance e = ENVI(/HEADLESS) ; Open a las file file = FILEPATH('5090_54490.las', ROOT_DIR=e.ROOT_DIR, $ SUBDIRECTORY = ['data','lidar']) pointcloud = e.OpenPointCloud(file, PROJECT_URI='J:\Lidar\2013Lidar\Native_LAS_Files') ; Get the point cloud feature extraction task from the catalog of ENVI tasks task = ENVITask('PointCloudFeatureExtraction') ; Define inputs Task.INPUT_POINT_CLOUD = pointcloud ; Make sure that DEM, building and trees generation is enabled Task.DEM_GENERATE = 1 Task.BUILDINGS_GENERATE = 1 Task.TREES_GENERATE = 1 ; Run the task Result = task.Validate(VALIDATION_EXCEPTION=msg) print, 'Executing Point Cloud Feature Extraction Task' Task.Execute ; Get the output product filenames productsInfo = Task.OUTPUT_PRODUCTS_INFO print, 'DEM Filename: ', productsInfo.DEM_URI print, 'Buildings Filename: ', productsInfo.BUILDINGS_URI print, 'Trees Filename: ', productsInfo.TREES_URI ; Close any open point cloud objects pointcloud.Close Are you able to advise on what the problem is? Thanks, Elton

    Deleted User



    New Member


    Posts:
    New Member


    --
    27 Jan 2016 09:29 PM
    Thanks for the help. I was able to correct the problem, and this is the working script. PRO PROPCL ; Create a headless instance e = ENVI(/CURRENT) ;Find all the files with .las extensions in a directory. search_dir = 'J:\Lidar\2013Lidar\Native_LAS_Files\TEST\' filelist = file_search(search_dir + '*.las') ; Get the point cloud feature extraction task from the catalog of ENVI tasks task = ENVITask('PointCloudFeatureExtraction') ; Make sure that DEM, building and trees generation is enabled Task.TREES_GENERATE = 1 foreach file, filelist, index do begin ; Open a las file pointcloud = e.OpenPointCloud(file, /CLOSE_PREVIOUS) ; Define inputs Task.INPUT_POINT_CLOUD = pointcloud ; Run the task Result = task.Validate(VALIDATION_EXCEPTION=msg) print, 'Executing Point Cloud Feature Extraction Task' Task.Execute ; Get the output product filenames productsInfo = Task.OUTPUT_PRODUCTS_INFO print, 'Trees Filename: ', productsInfo.TREES_URI ; Close any open point cloud objects pointcloud.Close endforeach END
    You are not authorized to post a reply.