lasindex - spatial indexing for LAS files to speed-up points inside rectangle/circle queries

Skip to first unread message

Martin Isenburg

May 14, 2011, 7:21:41 AM5/14/11
to LAStools - efficient command line tools for LIDAR processing

I am pleased to announce a new feature for all LAStools: spatial
indexing that allows much more efficient queries of the type "read all
the LIDAR points that fall inside this rectangle or this circle".

In order to use spatial indexing you simply create a spatial indexing
file using the new lasindex tool. This spatial indexing LAX file with
the ending *.lax needs to remain in the same folder as the *.las or
*.laz file.

Whenever this LAX file is present all LAStools will automatically use
it to speed-up access to the relevant areas of the LAS/LAZ file
whenever spatial queries of the type

-inside_tile ll_x ll_y size
-inside_circle center_x center_y radius
-inside_rectangle min_x min_y max_x max_y (or simply -inside)

appear in the command line of a LAStools call. This acceleration is
also available to users of the LASlib API. The LASreader class has
three new functions called

BOOL inside_tile(F32 ll_x, F32 ll_y, F32 size);
BOOL inside_circle(F64 center_x, F64 center_y, F64 radius);
BOOL inside_rectangle(F64 min_x, F64 min_y, F64 max_x, F64 max_y);

if any of these functions is called the LASreader will only return the
points that fall inside the specified region and use - when available
- the spatial indexing information in the LAX file created by

Here an example of a 10 times performance increase. The first call
uses the new '-inside_tile 1086000 954000 1000'. Because of the
spatial indexing file "points.lax" being available only a subset of
all points needs to be read to find those falling into the specified
tile. The second call uses the old filter '-clip_tile 1086000 954000
1000' and needs to read all points.

>>las2las -i points.las -nil -v -inside_tile 1086000 954000 1000
30 cells intersect tile 1.086e+006/954000/1000
reading 31023976 and writing all surviving points ...
total time: 12.64 sec. written 928434 surviving points.

>>las2las -i points.las -nil -v -clip_tile 1086000 954000 1000
reading 31023976 and writing all surviving points ...
total time: 127.343 sec. written 928434 surviving points.

The spatial indexing LAX file "points.lax" was created with

>> lasindex -i points.las
before complete 100000 -20
total cells/intervals 3407/197314 full 31023976 (5.52)
after minimum_points 100000
total cells/intervals 784/60238 full 31023976 (11.85)
largest interval gap increased to 1500
after maximum_intervals 15680
total cells/intervals 784/15680 full 31023976 (9.84)

This is an entirely new development for LAStools and has yet to
undergo more severe stress-testing. I would be happy to assist you
with testing spatial indexing. If you have questions or problems
please let me know so we can refine the interface if needed.

All the spatial indexing functionality as well as the lasindex tool
are LGPL-licensed.


Martin @lastools
Reply all
Reply to author
Message has been deleted
0 new messages