[pdal] libLAS to PDAL, how to write a LAS header from scratch in PDAL?

Mathieu Poulin mathieu.poulin at mvtgeosolutions.com
Thu Sep 2 07:48:20 PDT 2021


Hi Andrew,

Using options does seem to work but there is one thing I cannot find in the documentation and that is the min and max bounds. Previously, I used the header SetMin and SetMax functions. I have tried setting options for "min_x", "max_x", etc., I also tried the "bounds" option and tried to pass a BOX3D object to it and then a string with the correct format described here: https://pdal.io/stages/filters.crop.html#options, but nothing seems to work, I keep getting an error saying something along the lines of "unexpected argument".

The reason I am trying to do this is because I am getting an error that says: writers.las: Unable to convert scaled value (2.307896276e+12) to in32 for dimension 'X'. I found that the error is mentioned in the FAQ: https://pdal.io/faq.html. The thing is, I never had problems with positions fitting into a 32-bit integer before I switched to PDAL. I assume this is because I have not set my bounds properly, but I can't really be certain, it could also be that the scale or offset work differently in PDAL.

Could you help me fix this problem?

Regards,

- Mathieu Poulin

________________________________
From: Andrew Bell <andrew.bell.ia at gmail.com>
Sent: Tuesday, August 31, 2021 9:20 AM
To: Mathieu Poulin <mathieu.poulin at mvtgeosolutions.com>
Cc: pdal at lists.osgeo.org <pdal at lists.osgeo.org>
Subject: Re: [pdal] libLAS to PDAL, how to write a LAS header from scratch in PDAL?

Hi Mathieu,

You don't need to do anything. PDAL will write a LAS file with a properly constructed header. You can use options on the LAS writers if you want to alter some of the header field data.

On Tue, Aug 31, 2021 at 9:04 AM Mathieu Poulin <mathieu.poulin at mvtgeosolutions.com<mailto:mathieu.poulin at mvtgeosolutions.com>> wrote:
Hello everyone,

I am transitionning to PDAL from libLAS and so far almost everything has been easy to figure out. There is however one thing that I can not find any instructions on how to do, and that is how to write a LAS header in PDAL.

I've asked the question on Stackoverflow before finding this mailing list, so here is a link to it: https://stackoverflow.com/questions/68986302/writing-las-header-with-pdal-in-c. Hopefully, someone here has the answer that I am looking for.

Thanks in advance,

 - Mathieu Poulin
[https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=73d79a89bded]<https://stackoverflow.com/questions/68986302/writing-las-header-with-pdal-in-c>
Writing LAS header with PDAL in C++ - Stack Overflow<https://stackoverflow.com/questions/68986302/writing-las-header-with-pdal-in-c>
I am working on an application that writes LAS files from scratch based on lidar data. Previously, the application was built with LibLAS and it worked quite well. However, LibLAS has been discontin...
stackoverflow.com<http://stackoverflow.com>



_______________________________________________
pdal mailing list
pdal at lists.osgeo.org<mailto:pdal at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/pdal


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


More information about the pdal mailing list