-
Notifications
You must be signed in to change notification settings - Fork 86
Add overview (pyramid) generation for Cloud-Optimized GeoTIFF output #1150
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
to_geotiff() can write GeoTIFFs, but production Cloud-Optimized GeoTIFFs need internal overviews (image pyramids) for efficient tiled access at multiple zoom levels. Without overviews, COGs written by xarray-spatial still need a post-processing step through GDAL (gdaladdo) to be truly usable, which defeats the purpose of having native I/O.
Scope
- Generate 2x downsampled overviews and embed them in the output GeoTIFF.
- Configurable number of overview levels, or auto-calculate based on raster dimensions (keep halving until the smallest overview fits in a single tile).
- Resampling method per overview level:
nearestfor categorical dataaveragefor continuous datamodefor majority-class downsampling- Similar to what
gdaladdoprovides.
- Integrate with the existing
to_geotiff()/write_geotiff_gpu()pipeline so users get proper COGs in one call instead of writing a flat TIFF and running a separate tool.
Current workaround
Write a GeoTIFF with xarray-spatial, then shell out to gdaladdo and gdal_translate -of COG to add overviews and restructure. This adds a hard GDAL dependency and creates intermediate files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request