[pdal] Metrics calculation

Peder Axensten Peder.Axensten at slu.se
Mon Aug 31 06:05:12 PDT 2020


My group produces rasters of forest variables for all of Sweden (height, volume, biomass, etc.). We use ALS data that we have our own tools to filter and produce metrics (percentiles, stddev, etc.) from. These tools are implemented in C++ and use liblas to read and write laz-files, but as there is no active development on liblas anymore we would like to move our tools to use PDAL instead. It would probably be easier to use pdal just for reading/writing laz files, but we see obvious advantages with going all the way and implement the tools as full members of the pdal ecosystem.

Being new to PDAL I would very much appreciate any input on how to make this transition.

I’ve started with the tool to produce raster metrics. I copied the files for writers.gdal and renamed [what I think is] relevant parts.
Q1: Is this a good way to start, do you think? Or should I use something else to start from?

It compiles and when I execute “pdal —drivers” there is a writers.gdal.metrics item in the list. However, when I execute “pdal —options writers.gdal.metrics” I only get "Unable to create stage writers.gdal.metrics”. Before I start to change the actual code into general metrics calculation I want a way to run it and getting —options to work seemed the obvious start. Once that works the idea is to construct a simple pipe through my writer so I can start to incrementally change the code.
Q2: With —options, am I missing something that is obvious to you? Why the "Unable to create stage writers.gdal.metrics”?
Q3: Do you think this is a good way to do the transition to pdal or would you suggest a better way?

We have one tool to produce raster metrics from laz files and another to calculate plot metrics from a set of laz files and a csv file containing coordinates and radius of plots. They are coded in C++17 and structured as a library where the actual tools are rather short files that handles command line options and then make a call into the library. You specify what metrics you need in the command line options (see the —help output below). The library structure makes it pretty straightforward to add yet more metrics. We use a tool implemented in R for the actual modelling/prediction. These tools are executed from a make script to process tens of thousands of files in a paralleled manner.
Q4: Would there be a general interest for such drivers (writers.gdal.metrics and writers.text.metrics)? We’d be happy to eventually make the code open source.

Q5: Any other advice? :-)

Best regards,

Peder Axensten
Research engineer

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.


=======================================================================
The metric option from the —help:

--metrics              You may choose one or more from the metrics and metric sets:
                        --- Sets ---
                        basic-linear    (percent_ge150cm, std_dev, p30, p80, p95)
                        photogrammetry  (percent_ge150cm, std_dev, p30, p95, p0, rootmean3)
                        --- Metrics ---
                        coeff_of_var    the standard deviation divided by the mean
                        count_ge#cm     number of values >= # cm, where # is any integer
                        kurtosis        the kurtosis
                        L1-moment       L1-moment
                        L2-moment       L2-moment
                        L3-moment       L3-moment
                        L4-moment       L4-moment
                        mean            The mean of all values.
                        mean2           ( sum of values^2 )/( number of values )
                        mean3           ( sum of values^3 )/( number of values )
                        p#             percentile:  the value below which #% of all values are (Linear interpolation), where # is any integer in [0, 100]
                        percent_ge#cm   percentage of values >= # cm, where # is any integer
                        prop_ge#cm      proportion of values >= # cm, where # is any integer
                        rootmean2       ( ( sum of values^2 )/( number of values ) )^(1/2)
                        rootmean3       ( ( sum of values^3 )/( number of values ) )^(1/3)
                        skewness        the skewness
                        std_dev         the standard deviation
                         [give one or more of above specifiers]

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