developmentseed / landsat-util

A utility to search, download and process Landsat 8 satellite imagery
Creative Commons Zero v1.0 Universal
690 stars 147 forks source link

TIF is not recognised as a supported file format #194

Closed alx closed 6 years ago

alx commented 8 years ago

My system (debian) might be missing an important lib, I don't have this error on another system.

Command

/usr/local/bin/landsat download LC81980292015263LGN00 --dest=data -p --clip=1.3514147,43.5365284,1.3842081,43.5514638

Error

===> Source: AWS S3
===> Downloading: LC81980292015263LGN00_B4.TIF
     stored at data/LC81980292015263LGN00
===> Downloading: LC81980292015263LGN00_B3.TIF
     stored at data/LC81980292015263LGN00
===> Downloading: LC81980292015263LGN00_B2.TIF
     stored at data/LC81980292015263LGN00
===> Downloading: LC81980292015263LGN00_BQA.TIF
   100%      5.3 MiB     537.4 KiB/s            0:00:00 ETA    
     stored at data/LC81980292015263LGN00
===> Downloading: LC81980292015263LGN00_MTL.txt
   100%      7.7 KiB       7.7 KiB/s            0:00:00 ETA    
     stored at data/LC81980292015263LGN00
Clipping
     Band 4
Time spent : 14.71 seconds
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/landsat/image.py", line 356, in clip
    with rasterio.open(band_path) as src:
  File "/usr/local/lib/python3.4/dist-packages/rasterio/__init__.py", line 123, in open
    s.start()
  File "rasterio/_base.pyx", line 74, in rasterio._base.DatasetReader.start (rasterio/_base.c:2620)
  File "rasterio/_err.pyx", line 70, in rasterio._err.GDALErrCtxManager.__exit__ (rasterio/_err.c:994)
OSError: b"`data/LC81980292015263LGN00/LC81980292015263LGN00_B4.TIF' not recognised as a supported file format.\n"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/landsat", line 8, in <module>
    landsat.landsat.__main__()
  File "/usr/local/lib/python3.4/dist-packages/landsat/landsat.py", line 491, in __main__
    exit(*main(args))
  File "/usr/local/lib/python3.4/dist-packages/landsat/landsat.py", line 416, in main
    args.ndvigrey, bounds=bounds)
  File "/usr/local/lib/python3.4/dist-packages/landsat/landsat.py", line 472, in process_image
    bounds=bounds)
  File "/usr/local/lib/python3.4/dist-packages/landsat/image.py", line 94, in __init__
    self.scene_path = self.clip()
  File "/usr/local/lib/python3.4/dist-packages/landsat/decorators.py", line 11, in wrapped_f
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/landsat/image.py", line 390, in clip
    exit(e.message, 1)
AttributeError: 'OSError' object has no attribute 'message'
matthewhanson commented 6 years ago

Unable to reproduce. The develop branch has been updated to use a later version of rasterio, but this does seem to be an issue with a library on your system, probably GDAL.

Feel free to reopen if this issue occurs again.