[pdal] filters.hag_dem not generating HeightAboveGround

Nick Holshouser nickholshouser at gmail.com
Tue Jul 23 04:40:27 PDT 2024


>
>
> Hello Dom,
>

I had the same problem when writing the HeightAboveGround as extra_dims and
got the hint to use minor_version:4 - which resolved the issue. The data
was there but couldn't be read/displayed by pdal info.

Rerunning the pipeline using minor_version got the result I wanted.

    {

      "extra_dims": "HeightAboveGround=double",

      "filename": "GRID_2789/GRID_2789_HAGDIM_EPSG3857.laz",

      "inputs":

      [

        "writers_las1"

      ],

      "minor_version": "4",

      "pdal_metadata": "true",

      "tag": "writers_las2",

      "type": "writers.las"

    }

Then -p gets:

"points":

  {

    "point":

    {

      "Blue": 0,

      "Classification": 2,

      "EdgeOfFlightLine": 0,

      "GpsTime": 172651632,

      "Green": 94,

      "HeightAboveGround": 0,

      "Intensity": 18668,

      "NumberOfReturns": 1,

      "PointId": 54787,

      "PointSourceId": 0,

      "Red": 198,

      "ReturnNumber": 1,

      "ScanAngleRank": 15,

      "ScanDirectionFlag": 0,

      "UserData": 0,

      "X": -9169790.9,

      "Y": 4268594.4,

      "Z": 890.52
    }

I had missed this in the docs: https://pdal.io/en/latest/tutorial/las.html
(look for minor_version and extra_dims)


> regards, Nick
>



> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 23 Jul 2024 10:03:36 +0000
> From: Dom Jaskierniak <dom.jaskierniak at environment.nsw.gov.au>
> To: "pdal at lists.osgeo.org" <pdal at lists.osgeo.org>
> Subject: [pdal] filters.hag_dem not generating HeightAboveGround
>         output
> Message-ID:
>         <
> MEYPR01MB7640BCD29349AA45BA7CA91289A92 at MEYPR01MB7640.ausprd01.prod.outlook.com
> >
>
> Content-Type: text/plain; charset="us-ascii"
>
>
> 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.htm
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pdal
>
>
> ------------------------------
>
> End of pdal Digest, Vol 151, Issue 11
> *************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20240723/c9df8ac1/attachment.htm>


More information about the pdal mailing list