Skip to content

Commit

Permalink
Fix using GDAL to subset a non-geospatial image.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Sep 24, 2021
1 parent 7305d91 commit ff3a6e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion sources/gdal/large_image_source_gdal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ff3a6e5

Please sign in to comment.