stac-utils/pystac-client

Recent Sentinel assets are not returning for Element84 client

GabrielFerrariR opened this issue · 9 comments

Hi everybody,

I'm a newbie using STAC from this lib, I'm using the example code to retrieve info from sentinel-cogs and sentinel-l2a by a given bbox and date range, but the items retrieved come until the month of April, although the bucket is updated daily.

The code:

bbox = (-46.060307812791194,
 -20.447801001458558,
 -46.048410525486645,
 -20.431704068673795)

catalog = Client.open("https://earth-search.aws.element84.com/v0")

catalog.add_conforms_to("ITEM_SEARCH")
time_range = ['2023-07-01T00:00:00Z', '2023-08-01T00:00:00Z']
query = catalog.search(
    collections=["sentinel-s2-l2a-cogs"], datetime=time_range, limit=100, bbox=bbox)

items = list(query.items())
print(f"Found: {len(items):d} datasets")

I'm using catalog.add_conforms_to("ITEM_SEARCH") because the lib raise an error if i don't call this function. I don't know if this interfere in the search of recent assets.

I wonder if it might be better to use the newer version of earth-search. Here I have changed the catalog url to change v0 to v1 and changed the collection to "sentinel-2-l2a" and I get 6 results:

from pystac_client import Client

bbox = (-46.060307812791194,
 -20.447801001458558,
 -46.048410525486645,
 -20.431704068673795)

catalog = Client.open("https://earth-search.aws.element84.com/v1")

time_range = ['2023-07-01T00:00:00Z', '2023-08-01T00:00:00Z']
query = catalog.search(
    collections=["sentinel-2-l2a"], datetime=time_range, limit=100, bbox=bbox)

items = list(query.items())
print(f"Found: {len(items):d} datasets")

Thank you so much @jsignell, it worked. I was almost going insane trying to find what I was doing wrong. This info about client version is very obscure in the specific documentation.

yeah we should go through the docs and update them to v1

Actually I just looked through the docs and I don't see any references to "https://earth-search.aws.element84.com/v0". Do you know where you saw that url mentioned?

I went directly in the open data registry for Sentinel-cogs, in the description there is a hiper-link in the words Earth-search that links to v0, also the StacSpec documentation tutorial leads to the same version. I know these aren't the official Element84 client documentations, however they might mislead inexperienced people like me.

Thank you! That is super helpful.

You're welcome!

I think this link is the most clear about the usage of the client, it should be in the AWS dataset documentation or easier to find

I've opened two documentation PRs

I'm going to close this issue as complete, as the issue really is with the documentation that's out there in the wild, not with this repo. Please re-open if you think that's incorrect.