Lasclip: clip multiple shapefiles with LAS file

1,024 views
Skip to first unread message

Wan S

unread,
Jun 9, 2015, 12:03:41 PM6/9/15
to last...@googlegroups.com

Hi,

How to clip multiple shapefiles (139 shapefiles polygon) with lidar.las file??

First i try to clip one shapefiles (with many polygons including overlap polygon represent overlapping crown in dense tropical forest) and las files.

lasclip -i "c:\data\DSMheight.las" -poly "c:\data\TreePolygon.shp" -split -odir "c:\data" -o "lasclip.las"

ERROR: options '-split' and '-flag_as_withheld' cannot be combined

so i run this:

lasclip -i "c:\data\DSMheight.las" -poly "c:\data\TreePolygon.shp" -odir "c:\data" -o "lasclip.las"

ERROR: crossing constraint segments

ERROR: constraining 3 (199809.95/328833.39) to 4 (199810.37/328833.09) of polygon 26 with 36 points

i gave up and Im using the method to clip my shapefiles (polygon data) with Las file using batch file in FUSION software. 

C:\FUSION\PolyClipData /multifile /shape:139,* C:\data\TreePolygon.shp C:\data\Plots.las C:\data\DSMheight.las

 It works. It do the clip job.But because of the overlapping polygon, the process tend to missed around 17 tree plot data. So i split the polygon to become and individual polygon. So there is about 139 separated shapefiles represent one polygon. Im going to do analysis for individual tree so that's why an alternative for individual polygon is neccessary. But the things is i don't know how to write it in the batch file command to clip this 139 shapefiles data with one LAS file in one execution? 

Please someone tell me that lastools can do this. What's with the error above??? Is it a bug?

Thanks,

Wan

Susana Gonzalez

unread,
Jun 9, 2015, 6:33:10 PM6/9/15
to last...@googlegroups.com

Hi,

At the moment the best solution will be to split your shapefile and clip your data one by one.

 

lasclip -i c:\data\DSMheight.las -poly c:\data\TreePolygon1.shp -o c:\data \TreePolygon1.las

*

*until your last one

*

lasclip -i c:\data\DSMheight.las -poly c:\data\TreePolygon139.shp -o c:\data \TreePolygon139.las

 

Be patience… and you will get there.

The good thing of this script is that you don’t lost the name of the shapefile in the clipped LAS file.

Last comment…. Try to use LAZ.

 

Cheers

Susana

Adam P

unread,
Apr 21, 2016, 8:58:22 AM4/21/16
to LAStools - efficient tools for LiDAR processing
Any update on this? I may be doing something wrong but it looks like a bug. I would much prefer to use the -split feature than mess around with hundreds of shapefiles.

Thanks,
Adam

Martin Isenburg

unread,
May 6, 2016, 4:19:37 PM5/6/16
to LAStools - efficient command line tools for LIDAR processing
Hello,

maybe update to the latest version of LAStools? The workflow below works fine for me. Example images are attached. Well okay, they are not all "single buildings" ... (-:

Regards,

Martin @rapidlasso

D:\LAStools\bin>lasboundary -i ..\data\fusa.laz ^
                                           -keep_class 6 ^
                                           -disjoint -concavity 2 ^
                                           -o buildings.shp

D:\LAStools\bin>lasclip -i ..\data\fusa.laz ^
                                   -poly buildings.shp ^
                                   -split ^
                                   -o single_buildings.laz

D:\LAStools\bin>dir single_bu*

05/06/2016  10:11 PM             3,731 single_buildings_000000.laz
05/06/2016  10:11 PM             5,272 single_buildings_000001.laz
05/06/2016  10:11 PM             5,168 single_buildings_000002.laz
05/06/2016  10:11 PM             5,912 single_buildings_000003.laz
05/06/2016  10:11 PM             5,303 single_buildings_000004.laz
05/06/2016  10:11 PM             2,868 single_buildings_000005.laz
05/06/2016  10:11 PM             3,277 single_buildings_000006.laz
05/06/2016  10:11 PM             1,770 single_buildings_000007.laz
05/06/2016  10:11 PM            21,389 single_buildings_000008.laz
05/06/2016  10:11 PM            12,386 single_buildings_000009.laz
05/06/2016  10:11 PM             4,285 single_buildings_000010.laz
05/06/2016  10:11 PM             3,341 single_buildings_000011.laz
05/06/2016  10:11 PM            55,586 single_buildings_000012.laz
05/06/2016  10:11 PM            66,204 single_buildings_000013.laz
05/06/2016  10:11 PM            11,157 single_buildings_000014.laz

D:\LAStools\bin>lasview -i single_buildings_000000.laz
D:\LAStools\bin>lasview -i single_buildings_000001.laz
D:\LAStools\bin>lasview -i single_buildings_000008.laz
D:\LAStools\bin>lasview -i single_buildings_000013.laz

--
lasboundary_fusa_buildings.jpg
lasclip_single_buildings_0.jpg
lasclip_single_buildings_1.jpg
lasclip_single_buildings_8.jpg
lasclip_single_buildings_13.jpg
Reply all
Reply to author
Forward
0 new messages