intake / intake-stac

Intake interface to STAC data catalogs
https://intake-stac.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
108 stars 25 forks source link

Dynamic search example not working #160

Open MartinSchobben opened 6 months ago

MartinSchobben commented 6 months ago

There seems to be a discrepancy between intake-stac documentation examples on readthedocs and GitHub. The example explaining how STAC items are searched based on a query is different between those sources, where the former works with satsearchand the latter with pystac-client. Perhaps the former is outdated or the latter merely a development version. However none of these examples seem to work with the following package latest versions:

import satsearch
print(satsearch.__version__)
0.3.0
import intake
print(intake.__version__)
2.0.3
import intake_stac
print(intake_stac.__version__)
0.4.0
import pystac_client
print(pystac_client.__version__)
0.7.6

satsearch example

URL='https://earth-search.aws.element84.com/v0'

results = satsearch.Search.search(
    url=URL,
    collections=['landsat-8-l1-c1'],
    bbox=[43.16, -11.32, 43.54, -11.96]
    )
items = results.items()
catalog = intake.open_stac_item_collection(items)
list(catalog)
ValueError: Expected <class 'pystac.item_collection.ItemCollection'> instance, got: <class 'satstac.itemcollection.ItemCollection'>

pystac_client example

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

results = catalog.search(
    collections=["sentinel-s2-l2a-cogs"],
    bbox = [35.48, -3.24, 35.58, -3.14],
    datetime="2020-07-01/2020-08-15")

items = results.get_all_items()
catalog = intake.open_stac_item_collection(items)
list(catalog)
DoesNotConformTo: Server does not conform to ITEM_SEARCH, There is no fallback option available for search.