<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:3.0cm 2.0cm 3.0cm 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DA" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC">Ah, there it is!
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC">--readers.las.extra_dims="amplitude=uint16,pulse_width=uint16"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC">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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC">/Kristian</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Fra:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Andrew Bell [mailto:andrew.bell.ia@gmail.com]
<br>
<b>Sendt:</b> 3. oktober 2016 15:39<br>
<b>Til:</b> Kristian Evers<br>
<b>Emne:</b> Re: [pdal] Riegl extrabytes stripped<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">On Mon, Oct 3, 2016 at 7:59 AM, Kristian Evers <<a href="mailto:kreve@sdfe.dk" target="_blank">kreve@sdfe.dk</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Andrew,<br>
<br>
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.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">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.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">pdal translate<span style="font-size:9.5pt;font-family:"Arial","sans-serif";color:#404040;background:#FCFCFC"> -i in.laz -o out.laz --readers.las.extra_dims="amplitude=uint16,pulse_width=uint16" --writers.las.forward=vlr --writers.las.extra_dims=all</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Andrew Bell<br>
<a href="mailto:andrew.bell.ia@gmail.com" target="_blank">andrew.bell.ia@gmail.com</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>