rasterio.errors module

Errors and Warnings.

exception rasterio.errors.BandOverviewError

Bases: UserWarning

Raised when a band overview access fails.

exception rasterio.errors.CRSError

Bases: ValueError

Raised when a CRS string or mapping is invalid or cannot serve to define a coordinate transformation.

exception rasterio.errors.DatasetAttributeError

Bases: RasterioError, NotImplementedError

Raised when dataset attributes are misused

exception rasterio.errors.DatasetIOShapeError

Bases: RasterioError

Raised when data buffer shape is a mismatch when reading and writing

exception rasterio.errors.DriverCapabilityError

Bases: RasterioError, ValueError

Raised when a format driver can’t a feature such as writing.

exception rasterio.errors.DriverRegistrationError

Bases: ValueError

Raised when a format driver is requested but is not registered.

exception rasterio.errors.EnvError

Bases: RasterioError

Raised when the state of GDAL/AWS environment cannot be created or modified.

exception rasterio.errors.FileOverwriteError(message)

Bases: FileError

Raised when Rasterio’s CLI refuses to clobber output files.

exception rasterio.errors.GDALBehaviorChangeException

Bases: RuntimeError

Raised when GDAL’s behavior differs from the given arguments. For example, antimeridian cutting is always on as of GDAL 2.2.0. Users expecting it to be off will be presented with a MultiPolygon when the rest of their code expects a Polygon.

Examples

# Raises an exception on GDAL >= 2.2.0
rasterio.warp.transform_geometry(
    src_crs, dst_crs, antimeridian_cutting=False)
exception rasterio.errors.GDALOptionNotImplementedError

Bases: RasterioError

A dataset opening or dataset creation option can’t be supported

This will be raised from Rasterio’s shim modules. For example, when a user passes arguments to open_dataset() that can’t be evaluated by GDAL 1.x.

exception rasterio.errors.GDALVersionError

Bases: RasterioError

Raised if the runtime version of GDAL does not meet the required version of GDAL.

exception rasterio.errors.InvalidArrayError

Bases: RasterioError

Raised when methods are passed invalid arrays

exception rasterio.errors.NodataShadowWarning

Bases: UserWarning

Warn that a dataset’s nodata attribute is shadowing its alpha band.

exception rasterio.errors.NotGeoreferencedWarning

Bases: UserWarning

Warn that a dataset isn’t georeferenced.

exception rasterio.errors.OverviewCreationError

Bases: RasterioError

Raised when creation of an overview fails

exception rasterio.errors.PathError

Bases: RasterioError

Raised when a dataset path is malformed or invalid

exception rasterio.errors.RPCError

Bases: ValueError

Raised when RPC transformation is invalid

exception rasterio.errors.RasterBlockError

Bases: RasterioError

Raised when raster block access fails

exception rasterio.errors.RasterioDeprecationWarning

Bases: FutureWarning

Rasterio module deprecations

Following https://www.python.org/dev/peps/pep-0565/#additional-use-case-for-futurewarning we base this on FutureWarning while continuing to support Python < 3.7.

exception rasterio.errors.RasterioError

Bases: Exception

Root exception class

exception rasterio.errors.RasterioIOError

Bases: OSError

Raised when a dataset cannot be opened using one of the registered format drivers.

exception rasterio.errors.ResamplingAlgorithmError

Bases: RasterioError

Raised when a resampling algorithm is invalid or inapplicable

exception rasterio.errors.ShapeSkipWarning

Bases: UserWarning

Warn that an invalid or empty shape in a collection has been skipped

exception rasterio.errors.StatisticsError

Bases: RasterioError

Raised when dataset statistics cannot be computed.

exception rasterio.errors.TransformError

Bases: RasterioError

Raised when transform arguments are invalid

exception rasterio.errors.TransformWarning

Bases: UserWarning

Warn that coordinate transformations may behave unexpectedly

exception rasterio.errors.UnsupportedOperation

Bases: RasterioError

Raised when reading from a file opened in ‘w’ mode

exception rasterio.errors.WarpOperationError

Bases: RasterioError

Raised when a warp operation fails.

exception rasterio.errors.WarpOptionsError

Bases: RasterioError

Raised when options for a warp operation are invalid

exception rasterio.errors.WarpedVRTError

Bases: RasterioError

Raised when WarpedVRT can’t be initialized

exception rasterio.errors.WindowError

Bases: RasterioError

Raised when errors occur during window operations

exception rasterio.errors.WindowEvaluationError

Bases: ValueError

Raised when window evaluation fails