Skip to content

Commit c8d73ca

Browse files
authored
Add BigTIFF COG external compliance test and tier entry (#2303) (#2306)
Pins writer.bigtiff_cog at the ``advanced`` tier and lands the external-interop gate that has to soak in CI before a future PR can promote it to ``stable``. The compliance file exercises the BigTIFF layout (8-byte offsets, magic 43, BigTIFF IFDs) by forcing ``bigtiff=True`` on a small raster, plus an auto-promotion row that drives the UINT32_MAX threshold via the IFD-overhead helper rather than allocating a multi-gigabyte buffer. Closes #2303.
1 parent 86dcd8c commit c8d73ca

3 files changed

Lines changed: 408 additions & 0 deletions

File tree

docs/source/reference/geotiff.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,25 @@ returned with holes left as the band's nodata sentinel (or zero on
206206
integer bands without a sentinel). ``XRSPATIAL_GEOTIFF_STRICT=1``
207207
forces the raise in ``'warn'`` mode too, so CI environments can enforce
208208
fail-fast behavior globally.
209+
210+
BigTIFF COG (issue #2303)
211+
=========================
212+
213+
A COG larger than the classic-TIFF 4 GiB offset ceiling needs the
214+
BigTIFF wrapper (magic ``43``, 8-byte offsets, 20-byte IFD entries).
215+
``to_geotiff(..., cog=True)`` auto-promotes to BigTIFF when the
216+
estimated file size exceeds ``UINT32_MAX`` (0xFFFFFFFF bytes); callers
217+
can force the wrapper with ``bigtiff=True`` even on small rasters when
218+
they want a stable layout for downstream tooling that probes the magic
219+
byte. The same threshold and force-flag rules apply whether the output
220+
is a plain GeoTIFF or a COG.
221+
222+
``SUPPORTED_FEATURES['writer.bigtiff_cog']`` is currently ``advanced``.
223+
The external-interop gate lives in
224+
``xrspatial/geotiff/tests/test_bigtiff_cog_compliance_2286.py`` and
225+
covers the BigTIFF-specific layout (header, IFDs, tile and overview
226+
offset tables), one lossless integer codec, one lossless float codec,
227+
single-band and 3-band, one overview level, plus an auto-promotion row
228+
that drives the threshold via the IFD-overhead helper rather than
229+
allocating a multi-gigabyte buffer. Promotion to ``stable`` follows the
230+
same release-cycle soak rule as the rest of the COG surface.

xrspatial/geotiff/_attrs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,16 @@
290290
'writer.gpu': 'experimental',
291291
'writer.gdal_metadata_xml': 'experimental',
292292
'writer.extra_tags': 'experimental',
293+
# BigTIFF COG writer surface (issue #2303, part of #2286 wave D).
294+
# Tracked separately from ``writer.bigtiff`` and ``writer.cog`` because
295+
# the BigTIFF + COG combination has its own external-interop surface
296+
# (8-byte offsets in tile/overview tables, BigTIFF-form IFDs, COG
297+
# layout invariants). Stays ``advanced`` even when every row of
298+
# ``tests/test_bigtiff_cog_compliance_2286.py`` passes -- promotion
299+
# to ``stable`` happens after the gate has lived in CI for a release
300+
# cycle. See the BigTIFF COG section in
301+
# ``docs/source/reference/geotiff.rst``.
302+
'writer.bigtiff_cog': 'advanced',
293303
}
294304

295305

0 commit comments

Comments
 (0)