[pdal] filters.hag_dem not generating HeightAboveGround output
Andrew Bell
andrew.bell.ia at gmail.com
Wed Jul 24 06:22:25 PDT 2024
There is nothing that wasn't working as far as I can tell. You wrote a
version 1.2 file with an extra dimension "HeightAboveGround". This is
allowed by the 1.2 specification. PDAL writes an "extra_dims" VLR if there
are extra dimensions written to the file. It does this for all minor
versions, even though the VLR wasn't defined until version 1.4. PDAL will
read this VLR on a 1.2 file if you tell it to (see the "use_eb_vlr"
option), but you can also explicitly tell PDAL what data is tacked on to
the end of a standard point record with the "extra_dims" option.
The LAS specification isn't too long and is worth a read if you are going
to store data in the LAS format.
On Wed, Jul 24, 2024 at 1:36 AM Dom Jaskierniak via pdal <
pdal at lists.osgeo.org> wrote:
> 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
>
> _______________________________________________
> pdal mailing list
> pdal at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/pdal
>
--
Andrew Bell
andrew.bell.ia at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pdal/attachments/20240724/a664bdaf/attachment-0001.htm>
More information about the pdal
mailing list