[pdal] Writing multi-band rasters

Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[pdal] Writing multi-band rasters

Andreas Yankopolus
Is it possible to write multiple dimensions to a raster such as a GeoTIFF? For example: Z, Classification, Intensity, Red, Green, and Blue.

If not, is there a different format (IMG, etc.) that supports doing so?

Thanks,

Andreas
_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|

Re: [pdal] [EXTERNAL] Writing multi-band rasters

Newcomb, Doug
Andreas,
Geotiff supports multiple bands.  If your workflow is set up to generate a single band at a time, you can use gdalbuildvrt https://gdal.org/programs/gdalbuildvrt.html to make a virtual multiband raster of the individual bands , then gdal_translate , https://gdal.org/programs/gdal_translate.html#gdal-translate to convert your virtual multiband raster into a multiband geotiff.
This would be the brute force wayt of doing things, it could be made more elegant using python.

Doug 

From: pdal <[hidden email]> on behalf of Andreas Yankopolus <[hidden email]>
Sent: Wednesday, April 7, 2021 3:34 PM
To: [hidden email] <[hidden email]>
Subject: [EXTERNAL] [pdal] Writing multi-band rasters
 


 This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding.



Is it possible to write multiple dimensions to a raster such as a GeoTIFF? For example: Z, Classification, Intensity, Red, Green, and Blue.

If not, is there a different format (IMG, etc.) that supports doing so?

Thanks,

Andreas
_______________________________________________
pdal mailing list
[hidden email]
https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fpdal&amp;data=04%7C01%7Cdoug_newcomb%40fws.gov%7Ce0576150eda641b64a0e08d8f9fdf663%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637534216444777765%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&amp;sdata=fybmqp9RrDkTjpYdjORTles%2BWeV%2FzOlOVD1527aSmL4%3D&amp;reserved=0

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|

Re: [pdal] Writing multi-band rasters

Andreas Yankopolus
Doug,

Geotiff supports multiple bands. If your workflow is set up to generate a single band at a time, you can use gdalbuildvrt https://gdal.org/programs/gdalbuildvrt.html to make a virtual multiband raster of the individual bands , then gdal_translate , https://gdal.org/programs/gdal_translate.html#gdal-translate to convert your virtual multiband raster into a multiband geotiff.

I’m seeing that I could create one PDAL pipeline per dimension, so that if the target GeoTIFF had six dimensions, I’d have six JSON files writing six GeoTIFFs, then use GDAL to perform the merge and output a six-band GeoTIFF.

Is there a more elegant way to do this in PDAL, creating a single pipeline that processes six dimensions of data and writes it to a multi-band raster? My end goal is converting LAS files into rasters with separate bands for terrain height, surface height, and surface characteristics (ground, foliage, structure, etc).

I can get around well in GDAL, particularly the C++ API, but am new to PDAL Hence I don’t have a good sense on how it’s typically employed for more complex processing tasks.

Thanks,

Andreas

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|

Re: [pdal] Writing multi-band rasters

andrew.bell.ia@gmail.com
In reply to this post by Andreas Yankopolus


On Wed, Apr 7, 2021 at 3:46 PM Andreas Yankopolus <[hidden email]> wrote:
Is it possible to write multiple dimensions to a raster such as a GeoTIFF? For example: Z, Classification, Intensity, Red, Green, and Blue.

PDAL doesn't support this, but you can chain writers to get separate rasters. I assume GDAL has some VRT magic to merge the separate tiffs into a multi-band:

[
    "/pdal/test/data/las/autzen_trim.las",
    {
        "type":"writers.gdal",
        "dimension": "Red",
        "filename": "red.tif",
        "output_type": "idw",
        "resolution": 100
    },
    {
        "type":"writers.gdal",
        "dimension": "Green",
        "filename": "green.tif",
        "output_type": "idw",
        "resolution": 100
    }
]

--
Andrew Bell
[hidden email]

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|

Re: [pdal] Writing multi-band rasters

Andreas Yankopolus
Andrew,

> PDAL doesn't support this, but you can chain writers to get separate rasters. I assume GDAL has some VRT magic to merge the separate tiffs into a multi-band:

This is perfect. I can put the PDAL command inside a bash script that also calls GDAL to merge the scratch rasters into the multi-band final raster before cleaning them up.

Cheers,

Andreas
_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|

Re: [pdal] Writing multi-band rasters

Nicolas Cadieux-2
Hi,
You will find a Gdal example here. This script fuses a point cloud with hyperspectral data and vice versa. 

https://gitlab.com/njacadieux/3dcloud-hyperspectralfusion


Le 7 avr. 2021 à 17:04, Andreas Yankopolus <[hidden email]> a écrit :

Andrew,

PDAL doesn't support this, but you can chain writers to get separate rasters. I assume GDAL has some VRT magic to merge the separate tiffs into a multi-band:

This is perfect. I can put the PDAL command inside a bash script that also calls GDAL to merge the scratch rasters into the multi-band final raster before cleaning them up.

Cheers,

Andreas
_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal