Split points by polygon by specifying a field

79 views
Skip to first unread message

Rodrigo Saavedra

unread,
Jul 26, 2017, 10:06:01 PM7/26/17
to LAStools - efficient tools for LiDAR processing
Dear friends,

I am processing some data lidar and I would like to be able to divide the cloud of points of each polygon, for this I use lasclip adding as -split parameter.

However I export the .las files considering the attribute of the shapefile (fields: FID, KEY) called FID, my question is How could I indicate in the code to be able to export each .las with the name of another field (KEY) and not The FID?

This is an example code I am sending Martin and I am using:

Split the points of each pseudo plot polygon into separate files
>> lasclip -v -i ft _ *. Laz -merged -poly fn.shp -split -o plots.laz

Greetings and thanks

Yogendra Karna

unread,
Aug 11, 2017, 1:08:38 AM8/11/17
to LAStools - efficient tools for LiDAR processing
Hi Rodrigo,

Thanks for asking this thread. I also want to do the exactly same things, I want the clipped las files to be written on the name of desired attribute of shapefile. The split function only takes the FID column so I would also like to ask Martin what and how should I add the attribute of shapefile after -split in the lasclip code that you mentioned in the following code and found in this link.

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

Thanks and Regards,
Yogendra

Martin Isenburg

unread,
Dec 16, 2017, 10:03:37 PM12/16/17
to LAStools - efficient command line tools for LIDAR processing
Hello Rodrigo and Yogendra,

you may have already heard but I am cleaning out old unanswered forum posts. The functionality you ask for has been added as per this discussion thread:


lasclip -i lotsoflidar/*.laz -merged ^
           -poly myplots.shp ^
           -split SomeName ^
           -odir outputplots ^
           -olaz
 
Or
 
lasclip -i lotsoflidar/*.laz -merged ^
           -poly myplots.shp ^
           -split 3 ^
           -odir outputplots ^
           -olaz
 
Where SomeName is the name of the string field with the output file name or 3 is the index of the string field (count starts at 0) in the DBF file.

Yogendra Karna

unread,
Feb 16, 2018, 5:48:27 AM2/16/18
to last...@googlegroups.com
Hi Martin,

I tried this code to clip my lidar data but didn't produce the output in the name of string field. I have tried several times with both options but it didn't work, once I could have done it successfully but this time couldn't. The code and error shows as follows:

F:\Softwares\LasToolsLIcense\LAStools\bin>lasclip -i *.las -drop_z_below 0 -poly SiteBoundaryAll.shp -split SiteID -odix _clip -olas

ERROR: cannot understand argument SiteID

F:\Softwares\LasToolsLIcense\LAStools\bin>lasclip -i *.las -merged -drop_z_below 0 -poly SiteBoundaryAll.shp -split 3 -odix _clip -olas

ERROR: cannot understand argument 3

I have also attached my shapefile which I used for clipping.

Thanks and Regards,
Yogendra





Yogendra K. Karna
PhD Student
School of Ecosystem and Forest Sciences
The University of Melbourne

Water St., Creswick, VIC 3363, Australia

T: +61 3 5321 4257

M: 0410 207 191

E: yka...@student.unimelb.edu.au


------------------------------------

Under-Secretary (Technical)

Ministry of Forests and Soil Conservation

Government of Nepal


shpfile.7z

Martin Isenburg

unread,
Feb 16, 2018, 7:48:07 PM2/16/18
to LAStools - efficient command line tools for LIDAR processing
Hello,

I assume you are using an older version of LAStools where this option was not supported yet:

E:\LAStools\bin>lasclip -version
LAStools (by mar...@rapidlasso.com) version 180209 (academic)

Regards,

Martin

Reply all
Reply to author
Forward
0 new messages