Skip to content

Commit

Permalink
TileSourcePyramidFormatError -> TileSourceInefficientError
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Apr 27, 2022
1 parent 11cf2c0 commit 4d8c8e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion large_image/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TileSourceXYZRangeError(TileSourceError):
pass


class TileSourcePyramidFormatError(TileSourceError):
class TileSourceInefficientError(TileSourceError):
pass


Expand Down
8 changes: 4 additions & 4 deletions sources/gdal/large_image_source_gdal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
TileInputUnits, TileOutputMimeTypes)
from large_image.exceptions import (TileSourceError,
TileSourceFileNotFoundError,
TileSourcePyramidFormatError)
TileSourceInefficientError)
from large_image.tilesource import FileTileSource
from large_image.tilesource.utilities import getPaletteColors

Expand Down Expand Up @@ -1194,7 +1194,7 @@ def getRegion(self, format=(TILE_FORMAT_IMAGE, ), **kwargs):
def validateCOG(self, check_tiled=True, full_check=False, strict=True, warn=True):
"""Check if this image is a valid Cloud Optimized GeoTiff.
This will raise a :class:`large_image.exceptions.TileSourcePyramidFormatError`
This will raise a :class:`large_image.exceptions.TileSourceInefficientError`
if not a valid Cloud Optimized GeoTiff. Otherwise, returns True.
Requires the ``osgeo_utils`` package.
Expand All @@ -1221,9 +1221,9 @@ def validateCOG(self, check_tiled=True, full_check=False, strict=True, warn=True
full_check=full_check
)
if errors:
raise TileSourcePyramidFormatError(errors)
raise TileSourceInefficientError(errors)
if strict and warnings:
raise TileSourcePyramidFormatError(warnings)
raise TileSourceInefficientError(warnings)
if warn:
for warning in warnings:
self.logger.warning(warning)
Expand Down
4 changes: 2 additions & 2 deletions test/test_source_gdal.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pytest

from large_image import constants
from large_image.exceptions import TileSourceError, TileSourcePyramidFormatError
from large_image.exceptions import TileSourceError, TileSourceInefficientError

from . import utilities
from .datastore import datastore
Expand Down Expand Up @@ -560,5 +560,5 @@ def testVfsCogValidation():
imagePath = datastore.get_url('TC_NG_SFBay_US_Geo.tif')
source = large_image_source_gdal.open(
imagePath, projection='EPSG:3857', encoding='PNG')
with pytest.raises(TileSourcePyramidFormatError):
with pytest.raises(TileSourceInefficientError):
source.validateCOG()

0 comments on commit 4d8c8e8

Please sign in to comment.