[pdal] Fwd: Riegl extrabytes stripped

Andrew Bell andrew.bell.ia at gmail.com
Mon Oct 3 09:17:36 PDT 2016


On Mon, Oct 3, 2016 at 7:59 AM, Kristian Evers <kreve at sdfe.dk> wrote:

> Andrew,
>
> I think, in the case of version 1.1-1.3 LAS files, that the format of the
> extrabytes are not specified in the VLR header. It is simply not possible
> in the format specification, but it is still allowed to attach extra stuff
> at the end of a data record. How much extra stuff can be calculated from
> the information in the header about the record size, and the size of an
> un-altered record of a specific data format. I.e. knowing from the header
> that a record is 41 bytes and the data record point format 1 is 37 bytes we
> can infer that there must be 4 extra bytes in a record. What those bytes
> are is not specified in LAS files before version 1.4. And I guess that
> makes it hard for PDAL to understand how to treat those bytes, since
> there’s not a predefined dimension to put it in. Sorry if I am stating the
> obvious here, this stuff can be a bit confusing I think, so just trying
> make sure we agree on how to interpret the different LAS specifications.
>

It wasn't clear from your original note the version of the file you were
having problems with.  Very simply, the PDAL reader doesn't handle the
extra bytes VLR (LASF_Spec/4) in LAS files that aren't version 1.4.  As The
Riegl document states:

Please note: All versions will contain the VLR Header describing the
> meaning of the extrabytes. As this description mechanism is not defined
> expressively in the LAS specifications up to v1.3, existing readers are
> very likely to neglect this information.


The 'LASF_Spec' User ID in the VLR indicates that the VLR is defined in the
LAS specification.  If a VLR with 'LASF_Spec' exists but doesn't have a
known record ID for that file version, it will be ignored.  This seems
reasonable behavior to me.

If you are trying to read a LAS 1.1 - 1.3 file with extra bytes, you can
use the *readers.las* extra_dims option to describe them and load them into
PDAL.  At that point you should also be able to write them to a LAS file
using the extra bytes in a record by specifying extra_dims=all.  For
instance, if you are reading a LAS 1.2 file with extra bytes fields
amplitude and pulse width as described in the Riegl document, you should be
able to say:

pdal translate -i in.laz -o out.laz --readers.las.extra_dims="
amplitude=uint16,pulse_width=uint16" --writers.las.forward=vlr
--writers.las.extra_dims=all


If you also add '--writers.las.minor_version=4', the file should be written
as LAS 1.4 and the extrabytes VLR should be created.


-- 
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20161003/ccbaaac2/attachment.html>


More information about the pdal mailing list