3

I am looking for a method to clip with multiple shapefiles (139 shapefiles polygon) a lidar.las file.

I'm using the software Fusion, as described in: How to clip LAS data using shapefile polygons and open source software?

However, because of the overlapping polygons, the process tend to misses around 18 tree plots. So, I split the polygons to become and individual polygon. There is about 139 separated shapefiles representing one polygon each.

The question is:

How am I going to write it in the batch file command to clip this 139 shapefiles data with one LAS file in one execution? I understand the step is to quote the location of the software, shapefiles and lasfile. But what if I have hundreds of shapefiles to clip with one las file.

I cannot dissolve the polygon because each of the polygons represent crown tree (overlapping crown in the dense tropical forest). I'm going to do analysis for individual tree modelling so that's why an alternative for individual polygon is necessary. Using lasclip from lastools only allows to clip one shapefile with one las file.

The pattern in the shapefile's names is: tree_0.shp, tree_1.shp,.....until tree_138.shp

Can you help me on this? In terms of how to write the command?

  • tree_0.shp tree_1.shp .....until tree_138.shp – Wan S Jun 10 '15 at 17:09
1

Follow the instructions in my answer here to use the Fusion's command line PolyClipData.

Assuming you have:

  • shapefiles named tree_0.shp, tree_1.shp,...,tree_138.shp (as stated through comments).
  • the las file to be clipped with name data.las.
  • the fusion software stored directly under the c: drive.
  • the shp files and the las file stored under a folder named 'forest'

Write the following command line:

 FOR /L %%W IN (0,1,138) DO CALL c:\fusion\polyclipdata /index c:\forest\tree_%%W.shp c:\forest\clipped_data_%%W.las c:\forest\data.las

The FOR /L %%W IN (0,1,138) DO CALL part is a loop which will take one shapefile at a time to clip your main las file. In this case, the output will be 139 las files clipped by their respective shapefile.

I guess the time of processing will depend on how much is the number of shapefiles and the size of the main las file.

The /L part is a shortcut, so there is no need to write:

FOR %%W IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,....,138) DO CALL .....

With /L it reads the following between the brackets: (start,step,end).

The /index switch creates the .ldx and .ldi files which are necessary for visualization in the Fusion's viewer.

  • Thank you very much Andre. It works. It do the clipping job for the 139 shapefiles. Brilliant! Thanks for your time and help. – Wan S Jun 11 '15 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.