[pdal] Reading only specific fields from LAS files to improve performance.

Leona Swift leonaswift80 at gmail.com
Mon Mar 22 06:22:25 PDT 2021


Thanks,

Is it true to say that the code is still trivial when supporting up to,
e.g. LAS/LAZ 1.4 with all the compression variants commonly seen? I see
many examples of simple LAS 1.2, uncompressed file reading (and have one
here which works fine, and as you say the code is trivial.) I'm worried
about the number of variants of LAZ a production system will encounter in
practical use when consuming data from many vendors, which is the current
reason for using PDAL.

I agree that theoretically, code to rapidly pull XYZ points out of a binary
file sounds trivial, but am a little scared about going that route in case
it ends up taking 3 months to test all the variants of file encoding, and
it's tricky when looking at a general binary file spec to know how rigidly
all data will adhere to that spec in practice. Is there a good example of
such code somewhere else on the internet that we can look at?

On Mon, Mar 15, 2021 at 4:04 PM Andrew Bell <andrew.bell.ia at gmail.com>
wrote:

>
> I should add that if all you want is XYZ from a LAS (rather than LAZ), you
> really don't need PDAL at all, as the code is trivial. I'd need to know
> more about your use case to make better suggestions.
>
> On Mon, Mar 15, 2021 at 7:00 PM Andrew Bell <andrew.bell.ia at gmail.com>
> wrote:
>
>> Hi,
>>
>> You should look at
>>
>> this:
>> https://github.com/PDAL/PDAL/pull/3311/commits/db2d4a2539ad4551b62fee9711c51f0e0cbb939b
>>
>> This change allows a user to limit what gets loaded when using `pdal
>> translate` or `pdal pipeline`, but the code that's there can serve as an
>> example for your own.
>>
>> Note that this doesn't change what gets read from a file, just what gets
>> stored. We don't currently support the selective reading of data, though
>> this probably only much matters for LAZ with point formats 6-10.
>>
>> On Mon, Mar 15, 2021 at 6:32 PM Leona Swift <leonaswift80 at gmail.com>
>> wrote:
>>
>>> When using PDAL as part of a C++ codebase to read a large LAS/LAZ file
>>> from which we are only interested in the XYZ position of each point, import
>>> with PDAL is very slow. It looks like all of the other attributes in the
>>> PDAL file are being parsed. Additionally that parsing is very slow due to
>>> many type conversions, although the documentation is clear that PDAL is
>>> more concerned with genericity than efficiency.
>>>
>>> Is there any example in C++ of how to say "Only read the XYZ data from
>>> this file" to make things quicker?
>>>
>>> I assume that it is possible to do something (prepare the table
>>> differently) prior to calling execute() (which is where the time is spent.)
>>> However, there don't seem to be any code examples of doing this.
>>>
>>> las_reader.setOptions(las_opts);
>>> las_reader.prepare(table);
>>> pdal::PointViewSet point_view_set = las_reader.execute(table);
>>>
>>> (Actually, I haven't found any C++ examples at all other than
>>> https://pdal.io/api/transition/index.html).
>>> _______________________________________________
>>> pdal mailing list
>>> pdal at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/pdal
>>>
>>
>>
>> --
>> Andrew Bell
>> andrew.bell.ia at gmail.com
>>
>
>
> --
> Andrew Bell
> andrew.bell.ia at gmail.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20210322/e4ca6293/attachment.html>


More information about the pdal mailing list