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

Help with Search, returned items not filtered #122

Open
nikkopante opened this issue Jul 30, 2021 · 3 comments
Open

Help with Search, returned items not filtered #122

nikkopante opened this issue Jul 30, 2021 · 3 comments

Comments

@nikkopante
Copy link

nikkopante commented Jul 30, 2021

Hello I made a STAC API backend built with STAC standards, but is still limited. However some filters work such as bbox and 'datetime' you can check it on:
https://api.ops.dev.phl-microsat.upd.edu.ph/stac_management/stac/search?bbox=115.378418,5.375398,127.199707,19.352611

However when I use the library, it does not do any filtering. What could be the problem?

from satsearch import Search

URL='https://api.ops.dev.phl-microsat.upd.edu.ph/stac_management/stac'
results = Search.search(
    url=URL,
    collections=['diwata-2-smi'],
    bbox=[115.378418, 5.375398, 127.199707, 19.352611],
    #datetime='2021-01-01T00:00:00Z/2021-04-07T14:00:00Z'
)

items = results.items()
len(items) 

The result will be 12, or in this case it's my whole dataset. It does not filter unlike the search from the URL in the above example. Even with just bbox alone.

@nikkopante
Copy link
Author

I think my issue is connected with using the requests. https://github.com/sat-utils/sat-search/blob/master/satsearch/search.py#L76

Why is it that json argument was used instead of params?

@matthewhanson
Copy link
Member

@cnpante12 The json argument is used to supply the payload for POST requests, params is used for GET requests.

Also note that there is a replacement for sat-search, called pystac-client:
https://github.com/stac-utils/pystac-client

sat-search is no longer under active development.

@mdmaas
Copy link

mdmaas commented May 11, 2022

Hi @matthewhanson, maybe that information should go on the homepage. I don't like the prospect of working with unmaintained dependencies, so I guess I should migrate to pystac-client.

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

3 participants