-
Notifications
You must be signed in to change notification settings - Fork 2
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
Missing next
token when passed sortby
#27
Labels
bug
Something isn't working
Comments
Don't think so, because the items look like they have datetimes. Script: from itertools import islice
from pystac_client import Client, ItemSearch
def summarize(item_search: ItemSearch) -> None:
for i, page in enumerate(islice(item_search.pages_as_dicts(), 2)):
print(f"Page {i}")
next_link = next(link for link in page["links"] if link["rel"] == "next")
next_token = next_link["body"].get("next")
print(f"- Next token: {next_token}")
item = page["features"][0]
print(f"- First item datetime: {item['properties']['datetime']}")
for item in page["features"]:
datetime = item["properties"].get("datetime")
if not datetime:
print(f"Item with id={item['id']} is missing a datetime!!")
print()
client = Client.open("https://earth-search.aws.element84.com/v1/")
intersects = {"type": "Point", "coordinates": [-105.1019, 40.1672]}
item_search_without_sortby = client.search(
collections=["sentinel-2-l2a"],
intersects=intersects,
)
item_search_with_sortby = client.search(
collections=["sentinel-2-l2a"],
intersects=intersects,
sortby="properties.eo:cloud_cover",
)
print("=== Without sortby ===")
summarize(item_search_without_sortby)
print("\n=== With sortby ===")
summarize(item_search_with_sortby) Output:
|
resolved. running the code above gives:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue is described in detail in stac-utils/pystac-client#629 (comment), but td;dr: it looks like paging is broken if a
sortby
parameter is passed? I've checked for multiplesortby
keys (properties.datetime
andproperties.eo:cloud_cover
) and multiple collections (sentinel-2-l2a
andsentinel-2-c1-l2a
).The text was updated successfully, but these errors were encountered: