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

Sort not working #228

Open
barnabygordon opened this issue Jan 20, 2021 · 0 comments
Open

Sort not working #228

barnabygordon opened this issue Jan 20, 2021 · 0 comments

Comments

@barnabygordon
Copy link

Searching with a sort field doesn't seem to have an affect on the search results. I'm using the satsearch Python library, but the Post body it sends looks correct so I'm assuming the issue is either with the api or that I'm simply entering my sort argument incorrectly.

My search kwargs are:

{'bbox': [-110, 39.5, -105, 40.5],
 'datetime': '2020-07-01/2020-07-05',
 'query': {'eo:cloud_cover': {'lt': 10, 'gt': 0}},
 'collections': ['sentinel-s2-l2a-cogs'],
 'sort': [{'field': 'eo:cloud_cover', 'direction': 'desc'}],
 'limit': 500}

I'm using the Element84 url: "https://earth-search.aws.element84.com/v0"

However the items returned look like:

[S2A_13SED_20200705_0_L2A,
 S2A_13TEE_20200705_0_L2A,
 S2B_12TXK_20200703_0_L2A,
 S2B_12TYK_20200703_0_L2A,
 S2B_13TBE_20200703_0_L2A,
 S2A_13SED_20200702_0_L2A,
 S2A_13TDE_20200702_0_L2A,
 S2A_13TEE_20200702_0_L2A]

It looks like the result is sorted by date rather than cloud cover as requested. I've also tried changing field to datetime and altering the direction, but this has no effect.

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

1 participant