brazil-data-cube / stac.py

Python Client Library for SpatioTemporal Asset Catalog
MIT License
5 stars 16 forks source link

requests.exceptions.HTTPError: 404 Client Error: NOT FOUND for url #24

Closed AbnerErnaniADSFatec closed 4 years ago

AbnerErnaniADSFatec commented 4 years ago

Installation method

# pip install git+git://github.com/brazil-data-cube/stac.py@b-0.7.0#egg=stac

The following sample code is returning the wrong URL for STAC API

from stac import STAC
stac = STAC('http://brazildatacube.dpi.inpe.br/bdc-stac/0.7.0')
_ = stac.catalog
stac.collections.get('C64mMEDIAN').get_items('?limit=500000&time=2016-01-01/2018-01-01&bbox=-54.0,-12.0,-54.0,-12.0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/abner/miniconda3/envs/stac/lib/python3.8/site-packages/stac/collection.py", line 126, in get_items
    data = Utils._get(f'{link["href"]}/{item_id}')
  File "/home/abner/miniconda3/envs/stac/lib/python3.8/site-packages/stac/utils.py", line 37, in _get
    response.raise_for_status()
  File "/home/abner/miniconda3/envs/stac/lib/python3.8/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: NOT FOUND for url: http://brazildatacube.dpi.inpe.br/bdc-stac/0.7.0/collections/C64mMEDIAN/items/?limit=500000&time=2016-01-01/2018-01-01&bbox=-54.0,-12.0,-54.0,-12.0
mzaglia commented 4 years ago

Filters should be passed as a dictionary to the filter parameter in get_items