Element84 / earth-search

Earth Search information and issue tracking
https://earth-search.aws.element84.com/v1
27 stars 2 forks source link

is the query extension supported? #30

Closed rbavery closed 5 months ago

rbavery commented 6 months ago

the README references it, but when I try to use it to find Sentinel-2 L2A scenes that satisfy a cloud cover and tile requirement, I get no results

minimal repro below. the same query works with Planetary Computer.

import pystac_client
import planetary_computer
from shapely.geometry import Point
import stackstac
import xarray as xr

area_of_interest = Point((-120.963122, 37.025915)) # wright solar farm lon lat
range_old = "2015-01-01/2018-01-01"
range_new = "2020-01-01/2021-01-01"
max_cloud_cover = 15

catalog = pystac_client.Client.open(
    "https://planetarycomputer.microsoft.com/api/stac/v1",
    modifier=planetary_computer.sign_inplace,
)
search_new = catalog.search(
    collections=["sentinel-2-l2a"], 
    intersects=area_of_interest, 
    datetime=range_new, 
    query={"eo:cloud_cover": {"lt": max_cloud_cover}, 's2:mgrs_tile':{'eq':'10SFF'}}, 
    max_items=4 
)
items_new = search_new.item_collection()
print(len(items_new))

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

items_e84 = catalog_e84.search(
    collections=["sentinel-2-l2a"], 
    intersects=area_of_interest, 
    datetime=range_new, 
    query={"eo:cloud_cover": {"lt": max_cloud_cover}, 's2:mgrs_tile':{'eq':'10SFF'}}, 
    max_items=4 
).item_collection()
print(len(items_e84))
4
0

Sidenote, I was looking to test this endpoint because stackstac does not return a DataArray with band as a coordinate when using with the planetary computer endpoint (instead it is a dimension without a coordinate). It appears to do so in this example that uses Earth Search: https://stackstac.readthedocs.io/en/latest/basic.html#Basic-example

matthewhanson commented 5 months ago

@rbavery have you tried the new collection sentinel-2-c1-l2a rather than sentinel-2-l2a ?

rbavery commented 5 months ago

oh I wasn't aware of it, thanks!