lasclip doesn't do its work?

855 views
Skip to first unread message

Jack

unread,
Jul 19, 2011, 6:27:40 PM7/19/11
to LAStools - efficient command line tools for LIDAR processing
Hi Martin,

Thank you for your useful tool!

Today I tried to use lasclip.exe to clip a .las file using a .shp
polygon in command line as "lasclip -i input.las -poly area.shp -o
output.las", however, I got a warning like this: "Warning: written 0
points but expected 10373185 points". Any idea why this happen? (I
only put lasclip.exe with my data in the same path.)

Thank you for your time,
Jack

Martin Isenburg

unread,
Jul 19, 2011, 6:50:09 PM7/19/11
to LAStools - efficient command line tools for LIDAR processing
Hi Jack,

there is a little warning by LASlib whenever a LASwriter ends up
writing less points than was announced in the LASheader that gets
written when the LASwriter is opened. This is expected to happen when
you clip away points and there is no need to worry because the
LASheader gets updated to the correct value when the LASwriter is
closed.

But what is probably not supposed to happen is that all your points
get clipped away. Maybe the clipping polygon does not overlap the
LIDAR points? If you send me the LAS file and the SHP file I will have
a look. But please ... LASzip compress the LAS file before sending it.
(-:

Martin @lastools

Martin Isenburg

unread,
Aug 1, 2011, 11:08:11 AM8/1/11
to LAStools - efficient command line tools for LIDAR processing
hi,

lasclip now also accepts ASCII files (e.g. -poly clip.txt) as input
for the clipping polygon and prints out a warning if the bounding box
of your clip area does not overlap the bounding box of the LAS file.

but there seems to be some confusion which points are to be clipped
away by default and about the naming of inverting the clip operation.

currently the default is that lasclip clips away the points that fall
*INTO* the clip polygon as it was originally developed to remove
buildings from a LAS file when the building footprints are available
as polygons. it seems most people expect lasclip to remove all points
*OUTSIDE* the clip polygon.

unless i hear strong opinions against this i am planning to change the
default behavior so that in the (near) future

lasclip -i terrain_pts.las -poly shape.txt -o shape_pts.las

will clip away the points outside the shape, whereas

lasclip -i all.las -poly footprints.txt -o no_buildings.las -inside

will clip away the points inside the building footprints.

regards,

martin @lastools

Loesch, Tim N (DNR)

unread,
Aug 1, 2011, 11:22:16 AM8/1/11
to last...@googlegroups.com
Martin,

I can understand the confusion - as a GIS user (primarily ESRI oriented) clip functions generally work to retain features that fall within a polygon. ESRI has an -inside/-outside option which falls in line with your current proposal.

In ESRI command terminology ERASE is the tool that is used to get rid of features that fall inside polygons.

I think that what you have suggested is reasonable and workable.

tim

Timothy N. Loesch
GIS Operations Supervisor
Minnesota Department of Natural Resources
Phone: (651) 259-5475
E-Mail: tim.l...@state.mn.us
Lat   44.95609, Long -93.08388
www.mndnr.gov

 Please consider the environment before printing this e-mail.
--
You can download LAStools at
http://www.cs.unc.edu/~isenburg/lastools/
You can visit the LAStools group at
http://groups.google.com/group/lastools/
You can be social with LAStools at
http://www.facebook.com/LAStools
http://www.twitter.com/LAStools

Reply all
Reply to author
Forward
0 new messages