developmentseed / sat-gbdx

Library and CLI to search and access GBDX imagery
MIT License
3 stars 1 forks source link

Can not get the thumbnail #8

Closed Rub21 closed 6 years ago

Rub21 commented 6 years ago
[root@c7bb480d499b data]# sat-gbdx load TUR56/2018/scenes.geojson --download thumbnail
4 scenes found
ERROR:satsearch.scene:Unable to download https://geobigdata.io/thumbnails/v1/browse/3de44c1c-39ec-4525-b63d-33342e7aecc7-inv.large.png: Unable to download file https://geobigdata.io/thumbnails/v1/browse/3de44c1c-39ec-4525-b63d-33342e7aecc7-inv.large.png
Traceback (most recent call last):
  File "/usr/local/bin/sat-gbdx", line 11, in <module>
    load_entry_point('satgbdx==1.0.0b1', 'console_scripts', 'sat-gbdx')()
  File "/usr/local/lib/python3.6/site-packages/satgbdx/main.py", line 137, in cli
    main(**args)
  File "/usr/local/lib/python3.6/site-packages/satgbdx/main.py", line 59, in main
    scenes.download(key='thumbnail')
  File "/usr/local/lib/python3.6/site-packages/satsearch/scene.py", line 332, in download
    fname = s.download(**kwargs)
  File "/usr/local/lib/python3.6/site-packages/satgbdx/gbdx.py", line 98, in download
    geoimg = gippy.GeoImage(fname)
  File "/usr/local/lib64/python3.6/site-packages/gippy/gippy.py", line 3786, in __init__
    this = _gippy.new_GeoImage(*args)
ValueError: invalid null reference in method 'new_GeoImage', argument 1 of type 'gip::GeoImage const &'
[root@c7bb480d499b data]#

Metadata: scenes-2018.geojson.zip

matthewhanson commented 6 years ago

@Rub21 In this case the thumbnail is not available, and we should notify Digital Globe.

I've fixed by checking that the file was downloaded successfully before operating on the thumbnail.

If the file cannot be downloaded it prints an error message to the screen but does not stop the program, so the rest of the thumbnails for other scenes in the file will be downloaded.

Rub21 commented 6 years ago

@matthewhanson , We are having this issue mostly the latest years, (2018) we can get the thumbnails neither the full image.

[root@51bc3f84d85e COL27]# cd 2018/
[root@51bc3f84d85e 2018]# sat-gbdx load scenes.geojson --download thumbnail
2 scenes found
ERROR:satsearch.scene:Unable to download https://geobigdata.io/thumbnails/v1/browse/0e926d16-7f4e-4567-b598-d3e4a0e771bf-inv.large.png: Unable to download file https://geobigdata.io/thumbnails/v1/browse/0e926d16-7f4e-4567-b598-d3e4a0e771bf-inv.large.png
ERROR:satsearch.scene:Unable to download https://geobigdata.io/thumbnails/v1/browse/1867e88f-f728-4271-8584-eb1face3bff7-inv.large.png: Unable to download file https://geobigdata.io/thumbnails/v1/browse/1867e88f-f728-4271-8584-eb1face3bff7-inv.large.png

Metadata: scenes.geojson.zip

[root@51bc3f84d85e 2018]# sat-gbdx load scenes.geojson --download full
2 scenes found
Traceback (most recent call last):
  File "/usr/local/bin/sat-gbdx", line 11, in <module>
    load_entry_point('satgbdx==1.0.0b1', 'console_scripts', 'sat-gbdx')()
  File "/usr/local/lib/python3.6/site-packages/satgbdx/main.py", line 137, in cli
    main(**args)
  File "/usr/local/lib/python3.6/site-packages/satgbdx/main.py", line 62, in main
    satgbdx.download_scenes(scenes)
  File "/usr/local/lib/python3.6/site-packages/satgbdx/gbdx.py", line 218, in download_scenes
    order(scene)
  File "/usr/local/lib/python3.6/site-packages/satgbdx/gbdx.py", line 198, in order
    scene.feature['properties']['dg:order_id'] = gbdx.ordering.order(scene['id'])
  File "/usr/local/lib/python3.6/site-packages/gbdxtools/ordering.py", line 71, in order
    _order_single_batch(url, sanitized_ids[-remain_count:], res)
  File "/usr/local/lib/python3.6/site-packages/gbdxtools/ordering.py", line 47, in _order_single_batch
    r.raise_for_status()
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 939, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://geobigdata.io/orders/v2/order
[root@51bc3f84d85e 2018]#