Multi-polygons with same attribute in "lasclip -split"

197 views
Skip to first unread message

Guilherme Sanchez

unread,
Nov 7, 2021, 1:25:25 PM11/7/21
to last...@googlegroups.com
Hello Martin,
I have to clip a point cloud in lasclip from a complex polygon based on the -split command.
The problem occurs because some of these clips are by multi-polygon and lastools understands that each attribute is equivalent to only one polygon.
Follow the example:
image.png
These 3 polygons have the same name in the attribute and should be exported in a single file based on the command -split NAME or -split DSM or -split DTM or similar.
But the export comes out like this:
image.png
As I see it, it assumes that each DBF attribute is only related to a single polygon.
I would like the command to export in the same way as some other softwares, such as global mapper, which do this evaluation and clip by attribute and in multi-polygon:
Here is an illustrative example:
image.png

Best Regards.

Jorge Delgado

unread,
Nov 10, 2021, 3:26:48 PM11/10/21
to LAStools - efficient tools for LiDAR processing
Hi Guillerme, could you send an example of the laz file and corresponding SHP polygons?

Jorge

Guilherme Sanchez

unread,
Nov 13, 2021, 3:37:30 AM11/13/21
to last...@googlegroups.com
Hi Jochen Keil,

Good luck continuing Martin's work on LAStools. I wish you success!
About the ESRI Shapefile specification I don't know, but as I said, some software allows more than one polygon with the same name in the attribute to make the clip.
About using lasmerge after lasclip, I already do that. I also work around the "problem" in other ways, but this work becomes almost artisanal and the chances of error increase, in addition to increasing processing time.
My suggestion was to improve lasclip's -split command with this possibility (output generated by multi polygons having the same name), thus eliminating one or two processing after lasclip.
Also, at the request of Jorge Delgado, I created an example for you to take a look at.
In my example attached we have some laz files and a shapefile. This shapefile has 10 polygons, but only 6 names in the "PC" attribute.
The result of this operation should be something close to the one found in the "expected_output" folder.
But if you use the command
lasclip -i input\*.laz -merged -poly "SPLIT_TEST_clip.shp" -split PC -olaz -cores 4 -cpu64, you will see that some areas are not exported.

Best Regards,

--
Download LAStools at
http://lastools.org
https://rapidlasso.de
Manage your settings at
http://groups.google.com/group/lastools/subscribe
---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lastools/341089f6-3ac9-4685-b297-577927c727ben%40googlegroups.com.
lastools_split_multi_polygon.zip

Support at rapidlasso

unread,
Nov 13, 2021, 3:42:45 AM11/13/21
to LAStools - efficient tools for LiDAR processing
Hi Guilherme,
thank you for the sample files!
I will have a close look at this on monday.
At the moment we collect the issues and try to priorize those.
To improve the software is not the biggest problem - the main challenge right now is to identify the most urgent needs and issues.
Thank you all for the help on that!
Have a nice weekend @all,
Jochen

Support at rapidlasso

unread,
Nov 15, 2021, 8:54:20 AM11/15/21
to LAStools - efficient tools for LiDAR processing
Hi Guilherme,
thanks for the detailed files.
The program lasclip was not designed to handle shapes with the same name during a split operation.
Anyway, I think it would be a good new feature and we try to improve the program to handle this.
We will provide you a preview version soon so you can test this with your data.
After it passed all tests we will integrate it in the next release.
Best regards,
Jochen

Guilherme Sanchez

unread,
Nov 18, 2021, 3:10:16 PM11/18/21
to last...@googlegroups.com
Hi Jochen,
Very good! I'm waiting then.

Support at rapidlasso

unread,
Nov 29, 2021, 4:43:58 AM11/29/21
to LAStools - efficient tools for LiDAR processing
Hi Guilherme,
it's done - here's a test release of lasclip.
The output is not really binary identical to your sample - 
I hope you did some more during processing the files.
Otherwise please tell whats wrong with my output.

What lasclip is now able to do now:
The program keeps open all files and just append to the suitable file.
This is very performant. On the other hand: If you have more than
many 1000 shapes (~10k) your operating sytem may can't handle 
all the file handles anymore. This is the only limitation.
I extended the very-verbose output, so we can do more transparent tests.
Using -vv option on your sample 

lasclip -i .\input\*.laz -merged -poly SPLIT_TEST_clip.shp -split PC -olaz -odir out -vv

produces an output like this:

WARNING: first file is a buffered tile. maybe remove buffers first?
open merged input file [.\input\NP_7757000_650000.laz...] containing 8 files
creating first clip polygon took 0.004 sec.
define split filename [PC_7760-650_FP-041] by attrib name.
** create output file [out\PC_7760-650_FP-041.laz]
removed points 16568 (244). outputting 429 points took 0.008 sec.
creating clip polygon 1 took 0.001 sec.
define split filename [PC_7760-651_FP-041] by attrib name.
** create output file [out\PC_7760-651_FP-041.laz]
removed points 16948 (51). outputting 49 points took 0.004 sec.
creating clip polygon 2 took 0 sec.
define split filename [PC_7759-649_FP-041] by attrib name.
** create output file [out\PC_7759-649_FP-041.laz]
removed points 16889 (53). outputting 108 points took 0.005 sec.
creating clip polygon 3 took 0 sec.
define split filename [PC_7759-649_FP-041] by attrib name.
++ append output file [out\PC_7759-649_FP-041.laz]
removed points 16777 (31). outputting 220 points took 0.005 sec.
creating clip polygon 4 took 0.001 sec.
define split filename [PC_7759-650_FP-041] by attrib name.
** create output file [out\PC_7759-650_FP-041.laz]
removed points 16963 (14). outputting 34 points took 0.019 sec.
creating clip polygon 5 took 0.003 sec.
define split filename [PC_7759-650_FP-041] by attrib name.
++ append output file [out\PC_7759-650_FP-041.laz]
removed points 9168 (1680). outputting 7829 points took 0.057 sec.
creating clip polygon 6 took 0.001 sec.
define split filename [PC_7759-651_FP-041] by attrib name.
** create output file [out\PC_7759-651_FP-041.laz]
removed points 16995 (1). outputting 2 points took 0.007 sec.
creating clip polygon 7 took 0 sec.
define split filename [PC_7759-651_FP-041] by attrib name.
++ append output file [out\PC_7759-651_FP-041.laz]
removed points 16990 (5). outputting 7 points took 0.004 sec.
creating clip polygon 8 took 0.001 sec.
define split filename [PC_7759-651_FP-041] by attrib name.
++ append output file [out\PC_7759-651_FP-041.laz]
removed points 16638 (232). outputting 359 points took 0.008 sec.
creating clip polygon 9 took 0.002 sec.
define split filename [PC_7758-650_FP-041] by attrib name.
** create output file [out\PC_7758-650_FP-041.laz]
removed points 15324 (1077). outputting 1673 points took 0.02 sec.
done with 'out\PC_7758-650_FP-041.laz'. total time 0.159 sec.
closing 6 writers
file 'out\PC_7760-650_FP-041.laz' used 1 times
file 'out\PC_7760-651_FP-041.laz' used 1 times
file 'out\PC_7759-649_FP-041.laz' used 2 times
file 'out\PC_7759-650_FP-041.laz' used 2 times
file 'out\PC_7759-651_FP-041.laz' used 3 times
file 'out\PC_7758-650_FP-041.laz' used 1 times
destroy TIN
destroy point buffers
close reader

Everyone is welcome to test this release.


Best regards,
Jochen

Guilherme Sanchez

unread,
Nov 30, 2021, 2:27:18 PM11/30/21
to last...@googlegroups.com
Hello Jochen,

I performed some tests and the most conclusive was performed with a shapefile that contained 335 names distributed in 349 polygons.
And the export turned out completely correct (335 files with the geometry and distribution of points respected). Below is an illustrative image of a single exported file:

image.png
Would you like to know if this feature will also be included in the 64bit version of lasclip?
If so, will the 64-bit version continue with the 1000 shape limitation? Or would it be 10 thousand? It was not clear how much the limitation will be.

Even so, thank you very much for the improvement.

Best Regars, 
Guilherme Dias Sanchez

--
Download LAStools at

https://rapidlasso.de
Manage your settings at

---
You received this message because you are subscribed to the Google Groups "LAStools - efficient tools for LiDAR processing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lastools+u...@googlegroups.com.

Support at rapidlasso

unread,
Nov 30, 2021, 2:33:38 PM11/30/21
to LAStools - efficient tools for LiDAR processing
Hi Guilherme,
thanks for the positive feedback!
The limit of shapes should be around 10.000 - even in a WIN32 environment. I guess the filehandle limitation ist not affected by 32/64 bit.
We will add this feature also to 64 bit. But: Right now we plan to redesign the complete 64 bit build toolchain - so it will may take a while.
If there is a high demand of > 10000 shapes I may be able to fix this problem - it is just a bit more complicated...
Best regards,
Jochen

Guilherme Sanchez

unread,
Nov 30, 2021, 3:25:57 PM11/30/21
to last...@googlegroups.com
Jochen,

I frequently export LiDAR with files with more than 1000 polygons, but I have never worked with files with more than 10 thousand polygons. I believe it is a limit that will hardly be exceeded.
If the occasion comes, I ask for the change.
Now I'm going to work with this 32-bit version and I'm waiting for a new version with 64-bit adaptations.

Good luck!

Reply all
Reply to author
Forward
0 new messages