[pdal] filters.hag_dem not generating HeightAboveGround output
Dom Jaskierniak
dom.jaskierniak at environment.nsw.gov.au
Tue Jul 23 22:36:05 PDT 2024
Hi,
I found that filters.hag_dem was not generating HeightAboveGround output because I was working with a LAS 1.2 format, which does not support extra dimensions.
For it to work, it was necessary to put in "minor_version": 4 in:
{
"type": "writers.las",
"filename": output_file,
"minor_version": 4 # Ensure LAS 1.4 format
"extra_dims":"HeightAboveGround=float32"
}
It would be helpful for all operations that require extra dimensions to check the LAS format first and throw a warning if it format is not compatible with extra dimensions.
Regards,
Dom
-----Original Message-----
From: pdal <pdal-bounces at lists.osgeo.org> On Behalf Of pdal-request at lists.osgeo.org
Sent: Tuesday, July 23, 2024 8:04 PM
To: pdal at lists.osgeo.org
Subject: pdal Digest, Vol 151, Issue 11
Send pdal mailing list submissions to
pdal at lists.osgeo.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.osgeo.org/mailman/listinfo/pdal
or, via email, send a message with subject or body 'help' to
pdal-request at lists.osgeo.org
You can reach the person managing the list at
pdal-owner at lists.osgeo.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of pdal digest..."
Today's Topics:
1. filters.hag_dem not generating HeightAboveGround output
(Dom Jaskierniak)
----------------------------------------------------------------------
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
*************************************
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
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
More information about the pdal
mailing list