Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion xrspatial/geotiff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
from ._crs import _resolve_crs_to_wkt, _wkt_to_epsg # noqa: F401
from ._errors import (ConflictingCRSError, ConflictingNodataError, GeoTIFFAmbiguousMetadataError,
InvalidCRSCodeError, MixedBandMetadataError, NonUniformCoordsError,
RotatedTransformError, UnknownCRSModelTypeError, UnparseableCRSError)
RotatedTransformError, UnknownCRSModelTypeError, UnparseableCRSError,
UnsupportedGeoTIFFFeatureError)
from ._geotags import RASTER_PIXEL_IS_AREA, RASTER_PIXEL_IS_POINT, GeoTransform # noqa: F401
from ._reader import _MAX_CLOUD_BYTES_SENTINEL, UnsafeURLError
from ._reader import read_to_array as _read_to_array
Expand Down Expand Up @@ -115,6 +116,7 @@
'UnknownCRSModelTypeError',
'UnparseableCRSError',
'UnsafeURLError',
'UnsupportedGeoTIFFFeatureError',
'open_geotiff',
'read_geotiff_gpu',
'read_geotiff_dask',
Expand Down
17 changes: 17 additions & 0 deletions xrspatial/geotiff/_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ class UnknownCRSModelTypeError(GeoTIFFAmbiguousMetadataError):
"""


class UnsupportedGeoTIFFFeatureError(ValueError):
"""Caller asked for a feature this release does not implement (#2349).

Raised at the read or write entry point when the input declares a
feature the GeoTIFF module does not support (warped / reprojection
VRTs, pansharpened / processed / derived VRT subclasses, unknown
VRT band children, source transforms with non-zero skew on a VRT
mosaic). The message names the feature and points the caller at
:data:`xrspatial.geotiff.SUPPORTED_FEATURES` for the full tier map.

Subclasses ``ValueError`` so existing ``except ValueError`` callers
keep catching the case; new code can ``except`` this class to
distinguish "we refuse this input" from "the input is malformed".
"""


__all__ = [
"GeoTIFFAmbiguousMetadataError",
"InvalidCRSCodeError",
Expand All @@ -128,4 +144,5 @@ class UnknownCRSModelTypeError(GeoTIFFAmbiguousMetadataError):
"ConflictingCRSError",
"ConflictingNodataError",
"UnknownCRSModelTypeError",
"UnsupportedGeoTIFFFeatureError",
]
Loading
Loading