[pdal] filters.hag_dem not generating HeightAboveGround output

Dom Jaskierniak dom.jaskierniak at environment.nsw.gov.au
Tue Jul 23 03:03:36 PDT 2024


Hi,

I tried to generate HeightAboveGround values (using filters.hag_dem) and had no success with below code. The code successfully crops the las file but the output's metadata suggests there is no HeightAboveGround value. I tried to output the las files attributes in a text output to investigate and this also provides no extra dimension "HeightAboveGround". Any help would be appreciated.


# Generate the pipelines_SubGrid for each grid cell
    pipelines_SubGrid = []

    for x in range(min_x, max_x, grid_size):
        for y in range(min_y, max_y, grid_size):
            output_file = f"{output_dir}/tile_{x}_{y}.las"

            pipeline_grid_las = {
                "pipeline": [
                    {
                        "type": "readers.las",
                        "filename": input_file,
                        "spatialreference": "EPSG:4326"
                    },
                    {
                        "type": "filters.crop",
                        "bounds": f"([{x},{x + grid_size}], [{y},{y + grid_size}])"
                    },
                    {
                        "type":"filters.hag_dem",
                        "raster": dem_file
                    },
                    {
                        "type": "writers.las",
                        "filename": output_file,
                        "extra_dims":"HeightAboveGround=float32"
                    }
                ]
            }
            pipelines_SubGrid.append(pipeline_grid_las)


            ##########################
            pdal_pipeline = pdal.Pipeline(json.dumps(pipeline_grid_las))
            pdal_pipeline.execute()

Thanks in advance!


Regards,
Dom

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
This email is intended for the addressee(s) named and may contain confidential and/or privileged information. 
If you are not the intended recipient, please notify the sender and then delete it immediately.
Any views expressed in this email are those of the individual sender except where the sender expressly and with authority states them to be the views of the NSW Office of Environment and Heritage.

PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20240723/e4542bd1/attachment-0001.htm>


More information about the pdal mailing list