-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add INTERLEAVE=BAND option to COG driver #10859
Comments
One thing that is not entirely clear to me for INTERLEAVE=BAND in a cloud optimized context is how to place tiles in the file
Both could make sense, although I suppose first one would be slightly preferred and closer to what BSQ is. |
Both options are valid choices, and selecting one rather than the other heavily depends on the predicted/prevalent access scenarios. I would recommend making this choice user selectable via a configuration option. |
@cholmes @vincentsarago @joanma747 Do you expect some "disruption" of the COG ecosystem if GDAL would start writing multi-band COG files with INTERLEAVE=BAND ? (although that wouldn't be the default) |
Would be interesting to see what this means in terms of average loading times for the following use-case:
|
Let's imagine that your request intersects 2 tiles in the horizontal direction (thus consecutive)
Let's imagine that your request intersects 2 tiles in the vertical direction (thus non-consecutive)
(all the above assumes a "smart" reader. I'm not totally sure that the GDAL driver has all those read optimizations in the multi-band case) |
…RLEAVE=BAND Fixes OSGeo#10859 Up to now the COG driver only produced INTERLEAVE=PIXEL / PlanarConfiguration=Contiguous files where values for all bands are in the same tile. This PR add supports for INTERLEAVE=BAND where the tiles of band 1 are placed first, followed by the ones of band 2, etc. It also introduces a INTERLEAVE=TILE mode, which is similar to the BIL (Band Interleave by Line), but generalize to tiles. That is you put first tile (x,y)=(0,0) of band 1, then tile (0, 0) of band 2, ... tile (0, 0) of band N, tile (1, 0) of band 1, ... tile (1, 0) of band N, etc. Both modes can be useful for hyper-spectral datasets for example.
…RLEAVE=BAND Fixes OSGeo#10859 Up to now the COG driver only produced INTERLEAVE=PIXEL / PlanarConfiguration=Contiguous files where values for all bands are in the same tile. This PR add supports for INTERLEAVE=BAND where the tiles of band 1 are placed first, followed by the ones of band 2, etc. It also introduces a INTERLEAVE=TILE mode, which is similar to the BIL (Band Interleave by Line), but generalize to tiles. That is you put first tile (x,y)=(0,0) of band 1, then tile (0, 0) of band 2, ... tile (0, 0) of band N, tile (1, 0) of band 1, ... tile (1, 0) of band N, etc. Both modes can be useful for hyper-spectral datasets for example.
…RLEAVE=BAND Fixes OSGeo#10859 Up to now the COG driver only produced INTERLEAVE=PIXEL / PlanarConfiguration=Contiguous files where values for all bands are in the same tile. This PR add supports for INTERLEAVE=BAND where the tiles of band 1 are placed first, followed by the ones of band 2, etc. It also introduces a INTERLEAVE=TILE mode, which is similar to the BIL (Band Interleave by Line), but generalize to tiles. That is you put first tile (x,y)=(0,0) of band 1, then tile (0, 0) of band 2, ... tile (0, 0) of band N, tile (1, 0) of band 1, ... tile (1, 0) of band N, etc. Both modes can be useful for hyper-spectral datasets for example.
…RLEAVE=BAND Fixes OSGeo#10859 Up to now the COG driver only produced INTERLEAVE=PIXEL / PlanarConfiguration=Contiguous files where values for all bands are in the same tile. This PR add supports for INTERLEAVE=BAND where the tiles of band 1 are placed first, followed by the ones of band 2, etc. It also introduces a INTERLEAVE=TILE mode, which is similar to the BIL (Band Interleave by Line), but generalize to tiles. That is you put first tile (x,y)=(0,0) of band 1, then tile (0, 0) of band 2, ... tile (0, 0) of band N, tile (1, 0) of band 1, ... tile (1, 0) of band N, etc. Both modes can be useful for hyper-spectral datasets for example.
Cf #11541 for addition of INTERLEAVE=BAND and TILE in COG driver |
…RLEAVE=BAND Fixes OSGeo#10859 Up to now the COG driver only produced INTERLEAVE=PIXEL / PlanarConfiguration=Contiguous files where values for all bands are in the same tile. This PR add supports for INTERLEAVE=BAND where the tiles of band 1 are placed first, followed by the ones of band 2, etc. It also introduces a INTERLEAVE=TILE mode, which is similar to the BIL (Band Interleave by Line), but generalize to tiles. That is you put first tile (x,y)=(0,0) of band 1, then tile (0, 0) of band 2, ... tile (0, 0) of band N, tile (1, 0) of band 1, ... tile (1, 0) of band N, etc. Both modes can be useful for hyper-spectral datasets for example.
…RLEAVE=BAND Fixes OSGeo#10859 Up to now the COG driver only produced INTERLEAVE=PIXEL / PlanarConfiguration=Contiguous files where values for all bands are in the same tile. This PR add supports for INTERLEAVE=BAND where the tiles of band 1 are placed first, followed by the ones of band 2, etc. It also introduces a INTERLEAVE=TILE mode, which is similar to the BIL (Band Interleave by Line), but generalize to tiles. That is you put first tile (x,y)=(0,0) of band 1, then tile (0, 0) of band 2, ... tile (0, 0) of band N, tile (1, 0) of band 1, ... tile (1, 0) of band N, etc. Both modes can be useful for hyper-spectral datasets for example.
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).
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:
TILED=YES
andINTERLEAVE=BAND
(these images validate agains
osgeo_utils.samples.validate_cloud_optimized_geotiff
)How to reproduce
Additional context
No response
The text was updated successfully, but these errors were encountered: