[pdal] How to get las header info?

Peder Axensten Peder.Axensten at slu.se
Wed Mar 23 07:03:04 PDT 2022


I saw your reply on the list archive. Thanks! I’ll try the 2.4 release.

If I’d try to migrate the tool to a pdal plugin – is there a way to process a directory of files, to have them presented one by one to pdal::Filter::run or similar? Or how should I go about it?

Best regards,

Peder Axensten


> On 23 Mar 2022, at 10:14, Peder Axensten <Peder.Axensten at slu.se> wrote:
>
> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
> Dear list,
>
> Previously, I could obtain a pdal::LasHeader through:
>
> inline pdal::LasHeader get_header( const std::filesystem::path & path_ ) {
> pdal::LasHeaderheader;
> pdal::ILeStreaminput{ path_.native() };
> input >> header;
> return header;
> }
>
> But in the latest version of pdal the header copy constructor is implicitly deleted.
>
> – What would be the correct way to obtain header info now? Specifically the bounding box?
>
> I have a set of tools that initially used liblas to read and write files. These I have migrated into pdal plugins resulting in much simpler code. Some of my tools were no longer even needed since there were plugins that could be used instead. Thank you!
>
> One tool I did not migrate. It calculates metrics (such as percentile 95 of all first returns etc.) for a number of randomly located circular areas. These areas can be located in any [small] subset of the 60.000 or so las-files that together cover the land area of Sweden. So most las-files can be ignored and I need a cheap way to obtain the bounding box of a file to determine if it can be ignored. I know that the header info is correct, as I have previously normalised the z-values through pdal.
>
> – The best solution would be if I could migrate also this tool to a pdal plugin without loosing much efficiency. Any ideas?
>
> The tool needs to process all las-files of a specified directory (and its sud-directories). If I need to read the contents of files that could actually be ignored, it would increase processing time probably tenfolds. Is there a way to avoid this?
>    Maybe a previous stage in the pipeline to filter files based only on their header (bounding box) info?
>    If I implement it as a streaming operation, could I get the bounding box from header info and possibly not stream anything?
>
> Any suggestions are welcome.
>
> Best regards,
>
> Peder Axensten
> Systems Developer
>
> Remote Sensing
> Department of Forest Resource Management
> Swedish University of Agricultural Sciences
> SE-901 83 Umeå
> Visiting address: Skogsmarksgränd
> Phone: +46 90 786 85 00
> peder.axensten at slu.se, www.slu.se/srh
>
> The Department of Forest Resource Management is environmentally certified in accordance with ISO 14001.
>
> ---
> När du skickar e-post till SLU så innebär detta att SLU behandlar dina personuppgifter. För att läsa mer om hur detta går till, klicka här <https://www.slu.se/om-slu/kontakta-slu/personuppgifter/>
> E-mailing SLU will result in SLU processing your personal data. For more information on how this is done, click here <https://www.slu.se/en/about-slu/contact-slu/personal-data/>
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pdal

---
När du skickar e-post till SLU så innebär detta att SLU behandlar dina personuppgifter. För att läsa mer om hur detta går till, klicka här <https://www.slu.se/om-slu/kontakta-slu/personuppgifter/>
E-mailing SLU will result in SLU processing your personal data. For more information on how this is done, click here <https://www.slu.se/en/about-slu/contact-slu/personal-data/>


More information about the pdal mailing list