diff --git a/CHANGELOG.md b/CHANGELOG.md index e0397f7a5..72b90cca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Bug Fixes - getBandInformation could fail on high bands in some cases (#651) - Band information should always be 1-indexed (#659) +- Use GDAL to subset a non-geospatial image (#662) ## Version 1.8.0 diff --git a/sources/gdal/large_image_source_gdal/__init__.py b/sources/gdal/large_image_source_gdal/__init__.py index 34be6aba4..3b5244108 100644 --- a/sources/gdal/large_image_source_gdal/__init__.py +++ b/sources/gdal/large_image_source_gdal/__init__.py @@ -1124,11 +1124,13 @@ def getRegion(self, format=(TILE_FORMAT_IMAGE, ), **kwargs): outHeight = iterInfo['output']['height'] gdalParams = large_image.tilesource.base._gdalParameters( defaultCompression='lzw', **kwargs) + gdalParams += ['-t_srs', srs] if srs is not None else [ + '-to', 'SRC_METHOD=NO_GEOTRANSFORM'] gdalParams += [ - '-t_srs', srs, '-te', str(tl[0]), str(br[1]), str(br[0]), str(tl[1]), '-ts', str(int(math.floor(outWidth))), str(int(math.floor(outHeight))), ] + fd, outputPath = tempfile.mkstemp('.tiff', 'tiledGeoRegion_') os.close(fd) try: