[Liblas-devel] How to use a cached reader (c++)

Howard Butler howard at hobu.co
Mon Mar 14 12:29:25 PDT 2016


> On Mar 14, 2016, at 9:54 AM, Helimap Postmaster <postmaster at helimap.ch> wrote:
> 
> Hello!
> 
> I am currently developing an application which would benefit from using a buffer when reading a las file.
> 
> The C++ API has a CreateCached method in the ReaderFactory, but I can't seem to discover which is the intended way to use it, there's no reference anywhere on the documentation, and actually no other method calls it.
> 
> Is it as simple as 
> 
> liblas::ReaderFactory readerFactory;
> boost::uint32_t cache_size = 1000;
> liblas::Reader reader(lasFStream, cache_size);

Pol,

I would suggest if you are starting fresh with including LAS reading into your software that you start with either PDAL http://pdal.io or LASlib https://github.com/LAStools/LAStools/tree/master/LASlib

For LAS files, PDAL is going to allow you to read in a one-at-a-time streamed fashion or as a giant single buffer. It of course also supports LASzip and many other point cloud format types.

Thanks,

Howard

PS libLAS is now in "maintenance mode" and should only be used by projects that have historically used it in the past. If you are doing new things, you should use PDAL or look to other things like LASlib


More information about the Liblas-devel mailing list