-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Feature description
Request
It is requested to enhance the COG driver by an option to create COG rasters with band interleave, i.e. an creation option INTERLEAVE=BAND, similar those existing in the GTiff driver.
Problem
According to the OGC COG specification, COGs with multiple bands may be stored with pixel interleave (BIP) or band interleave (BSQ).
When more than one component is encoded in a TIFF file, the TIFF provides two possibilities.
The component values for each pixel are stored contiguously.
This is marked in the file as PlanarConfiguration=Contig (a.k.a. Chunky format, value 1).
This is a common arrangement for RGB combinations of bands. The data is stored as
RGBRGBRGB… (this arrangement is also known as Band Interleaved by Pixel, BIP).The components are stored in separate component planes. This is marked in the file
as PlanarConfiguration=Separate (a.k.a. Planar format, value 2). This is the common
arrangement for the bands of a multispectral image (this arrangement is also known
as Band Sequential, BSQ).
By now (GDAL 3.9.2), the COG driver supports BIP only. Unfortunatelly, COGs generated in this way for multiband datsets, e.g. hyperspectral satellite data with more than 100 bands, cannot be visualized smoothly. The loading times for block-by-block band information, e.g. to visualize them in QGIS, are simply too long.
Workaround
A current workaround to create BSQ COGs for such kind of raster data is to:
- use the GTiff driver and create a raster with
TILED=YESandINTERLEAVE=BAND - run gdaladdo to create overview images
- run cogger to create the COG images
(these images validate againsosgeo_utils.samples.validate_cloud_optimized_geotiff)
How to reproduce
- Start QGIS
- Open Datasource Manager -> Raster -> Protocol
- add url to this BSQ COG (created with GDAL + cogger) ENMAP01-____L2A-DT0000001867_20220724T104526Z_008_V010302_20230628T165614Z-SPECTRAL_IMAGE.BSQ_COG.tiff. This BSQ COG was created with the workaround described above. However, it would be nice if GDAL could create these BSQ COGs itself.
- zoom to native resolution and apply this *.qml style ENMAP01-____L2A-DT0000001867_20220724T104526Z_008_V010302_20230628T165614Z-SPECTRAL_IMAGE.BSQ_COG.qml to optimize visualization
- zoom and pan around to get a feeling for the loading times.
- Now repeat steps 3-6 with the BIP COG ENMAP01-____L2A-DT0000001867_20220724T104526Z_008_V010302_20230628T165614Z-SPECTRAL_IMAGE.BIP_COG.tiff. This image was created with the GDAL COG driver (GDAL 3.9.2.).
Additional context
No response
