Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

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

Closed
AbnerErnaniADSFatec opened this issue Mar 2, 2020 · 1 comment

Comments

@AbnerErnaniADSFatec
Copy link
Member

AbnerErnaniADSFatec commented Mar 2, 2020

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
Copy link
Contributor

mzaglia commented Mar 2, 2020

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

@mzaglia mzaglia closed this as completed Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants