Current behaviour
read_vrt in _vrt.py defaults missing_sources='warn'. When a backing source can't be read, the call:
- emits
GeoTIFFFallbackWarning,
- appends a record to
vrt.holes (surfaced as attrs['vrt_holes'] on the public DataArray), and
- continues, leaving the destination region filled with the buffer's
fill value (NaN for float, 0 for integer).
missing_sources='raise' and XRSPATIAL_GEOTIFF_STRICT=1 both already raise.
The concern
For an integer raster without a nodata sentinel, the zero-fill hole is indistinguishable from real zero-valued data unless the caller checks attrs['vrt_holes']. Before a stable release, that default is too lenient.
Options
(a) Switch default to 'raise'.
(b) Hybrid 'auto' default.
- Pro: only raises when the affected band lacks a nodata sentinel (the actually-ambiguous case). Float bands and integer-with-nodata bands keep the lenient path.
- Con: three-valued policy is harder to document and reason about. Doesn't fully solve the loss-of-provenance problem (the caller still has to inspect
vrt_holes to know which source failed).
(c) Keep 'warn'.
- Pro: no break. The strict env var and
vrt_holes attr already give safety-conscious callers an opt-in.
- Con: defaults are what most callers use. Pre-stable is when defaults should tighten, not stay loose.
Chosen direction: (a)
The module has been hardening toward stable with consistent up-front rejection of malformed input. A silent zero-fill on a Byte raster is the one place lenience still leaks through. The escape hatch already exists and is one kwarg long.
The env var XRSPATIAL_GEOTIFF_STRICT=1 stays orthogonal (force-raise across the whole module).
Scope
This issue covers the internal read_vrt in xrspatial/geotiff/_vrt.py. Aligning the public dispatcher default in __init__.py is a separate follow-up.
Current behaviour
read_vrtin_vrt.pydefaultsmissing_sources='warn'. When a backing source can't be read, the call:GeoTIFFFallbackWarning,vrt.holes(surfaced asattrs['vrt_holes']on the public DataArray), andfillvalue (NaN for float, 0 for integer).missing_sources='raise'andXRSPATIAL_GEOTIFF_STRICT=1both already raise.The concern
For an integer raster without a nodata sentinel, the zero-fill hole is indistinguishable from real zero-valued data unless the caller checks
attrs['vrt_holes']. Before a stable release, that default is too lenient.Options
(a) Switch default to
'raise'.missing_sources='warn'(one kwarg).(b) Hybrid
'auto'default.vrt_holesto know which source failed).(c) Keep
'warn'.vrt_holesattr already give safety-conscious callers an opt-in.Chosen direction: (a)
The module has been hardening toward stable with consistent up-front rejection of malformed input. A silent zero-fill on a
Byteraster is the one place lenience still leaks through. The escape hatch already exists and is one kwarg long.The env var
XRSPATIAL_GEOTIFF_STRICT=1stays orthogonal (force-raise across the whole module).Scope
This issue covers the internal
read_vrtinxrspatial/geotiff/_vrt.py. Aligning the public dispatcher default in__init__.pyis a separate follow-up.