[pdal] How to get las header info?

Peder Axensten Peder.Axensten at slu.se
Wed Mar 23 02:14:37 PDT 2022


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/>


More information about the pdal mailing list