Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with pystac #15

Open
zxdawn opened this issue Aug 23, 2024 · 0 comments
Open

Incompatible with pystac #15

zxdawn opened this issue Aug 23, 2024 · 0 comments
Assignees

Comments

@zxdawn
Copy link

zxdawn commented Aug 23, 2024

Describe the bug

To search Carbon Mapper products using pystac, I need to set the method as GET manually. According to pystac's function guide, if the status is 405, the method should change from "POST" to "GET" automatically. I see the status returned from Carbon Mapper is 422. It would be nice to make pystac work for Carbon Mapper API by default.

To Reproduce
Steps to reproduce the behavior:

from pystac_client import Client
from shapely import Point

lat_center = 19.324569
lon_center = -98.804675

point = Point(lon_center, lat_center)
bbox = point.buffer(0.05).bounds

params = {
    "bbox": bbox,
    "collections": "l3a-ch4",
    # "method": 'GET',
    "method": 'POST',
}

api_url = "https://api.carbonmapper.org/api/v1/stac/"
cat = Client.open(api_url)

search = cat.search(**params)
items = search.item_collection()
@demiurg demiurg self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants