[pdal] Riegl extrabytes stripped

Howard Butler howard at hobu.co
Mon Oct 3 08:28:56 PDT 2016


Kristian,

If you have notes, tutorial, or example to contribute on this topic, feel free to make pull requests in the docs where you think this kind of information would fit best. We really appreciate those kinds of contributions (like you've done for Proj.4).

Howard

> On Oct 3, 2016, at 9:52 AM, Kristian Evers <kreve at sdfe.dk> wrote:
> 
> Ah, there it is!
>  
> --readers.las.extra_dims="amplitude=uint16,pulse_width=uint16"
>  
> I completely missed that option. I expected PDAL to just transfer the complete data records when running a basic read-write pipeline, but the way it works makes sense when you think about the format-independent nature of PDAL. It is a bit cumbersome to use the extrabytes in las version earlier than 1.4. For now I am stuck with version 1.3 and will just have to pay extra attention when reading/writing files.
>  
> Thank you very much for your help Andrew, Pete and Howard. The fast response on this list and the endless possibilities of PDAL never cease to amaze me.
>  
> /Kristian
>  
> Fra: Andrew Bell [mailto:andrew.bell.ia at gmail.com] 
> Sendt: 3. oktober 2016 15:39
> Til: Kristian Evers
> Emne: Re: [pdal] Riegl extrabytes stripped
>  
> 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
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pdal



More information about the pdal mailing list