Tile Source getRegion(format='numpy') raises error
Closed this issue · 0 comments
annehaley commented
I have a cloud-optimized geotiff and I'd like to get the full image data at full resolution as a numpy array. I have tried to use getRegion(format='numpy')
for this but the following error is raised:
line 62, in get_raster_data
source.getRegion(
File "/usr/local/lib/python3.10/site-packages/large_image/tilesource/base.py", line 2058,
in getRegion
iterInfo = self._tileIteratorInfo(**kwargs)
File "/usr/local/lib/python3.10/site-packages/large_image/tilesource/base.py", line 605,
in _tileIteratorInfo
magLevel = self.getLevelForMagnification(**magArgs)
File "/usr/local/lib/python3.10/site-packages/large_image/tilesource/base.py", line 2471,
in getLevelForMagnification
mag = self.getMagnificationForLevel()
File "/usr/local/lib/python3.10/site-packages/large_image/tilesource/base.py", line 2443,
in getMagnificationForLevel
if mag.get('level') == self.levels - 1:
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
From my initial attempt to study the code, it looks like the mag
object output from getNativeMagnification
just lacks a key "level".
I have included the output of tifftools dump
on the image in question.