sat-utils / sat-search

A python client for sat-api
MIT License
189 stars 43 forks source link

Getting sentinel-2 data while querying for landsat-8-l1 #128

Closed ishaankochhar closed 2 years ago

ishaankochhar commented 2 years ago

Sat-search returns sentinel-2 data when I try to search for landsat-8 data.

import satsearch
print(satsearch.__version__)
from satsearch import Search`

0.3.0

url_earth_search = 'https://earth-search.aws.element84.com/v0'
eo_query = {"eo:cloud_cover": {"lt": 10}}
bbox = (-123.1738249999999937,37.6403143000000000, -122.2814790000000045,37.9298110000000008)

timeRange = '2022-05-01/2022-05-20'

# STAC metadata properties
properties =  ['eo:row=044',
               'eo:column=034']

results = Search.search(collection='landsat-8-l1',
                        url = url_earth_search,
                        bbox=bbox,
                        datetime=timeRange,
                        property=properties,
                        query = eo_query,
                        sort=['<datetime'],
                        max_items = 10,
                        )

print('%s items' % results.found())
items = results.items()
items.save('subset.geojson')

for item in items:
    print(item)

30 items S2B_10SDG_20220519_0_L2A S2B_10SDG_20220519_0_L2A S2A_10SDG_20220517_0_L2A S2A_10SDG_20220517_0_L2A S2A_10SEG_20220517_0_L2A S2A_10SEG_20220517_0_L2A S2A_10SDH_20220517_0_L2A S2A_10SDH_20220517_0_L2A S2A_10SEH_20220517_0_L2A S2A_10SEH_20220517_0_L2A S2A_10SEG_20220514_0_L2A S2A_10SEG_20220514_0_L2A S2A_10SDH_20220514_0_L2A S2A_10SDH_20220514_0_L2A S2A_10SEH_20220514_0_L2A S2A_10SEH_20220514_0_L2A S2B_10SDG_20220512_0_L2A S2B_10SDG_20220512_0_L2A S2B_10SEG_20220512_0_L2A S2B_10SEG_20220512_0_L2A S2B_10SDH_20220512_0_L2A S2B_10SDH_20220512_0_L2A S2B_10SDG_20220509_0_L2A S2B_10SDG_20220509_0_L2A S2A_10SDH_20220507_0_L2A S2A_10SDH_20220507_0_L2A S2A_10SEH_20220507_0_L2A S2A_10SEH_20220507_0_L2A S2A_10SEH_20220504_0_L2A S2A_10SEH_20220504_0_L2A

xxie12 commented 2 years ago

SAME HERE

xxie12 commented 2 years ago

I fixed this, instead of using collection: using collections: in Search.search

ishaankochhar commented 2 years ago

Great ! Thanks

xxie12 commented 2 years ago

When I tried to retrieve the Landsat 8 product it showed this, does this mean the product is no longer available then where should I find them? Thanks.

https://user-images.githubusercontent.com/82345895/175083940-7d697a8a-62d9-4398-ac6c-2b045ec57fb5.png

sdscscs

matthewhanson commented 2 years ago

Note that Earth-Search only has a small number of Landsat scenes indexed, and even those are deprecated Landsat Collection 1. The data may not even be available any more on AWS, it was to be deleted at some point.

The latest Landsat data (Collection 2) is available through the official USGS STAC API here: https://landsatlook.usgs.gov/stac-server

Also note that this library, sat-search, is no longer maintained, and you should switch to using pystac-client https://github.com/stac-utils/pystac-client

xxie12 commented 2 years ago

Thank you so much!

xxie12 commented 2 years ago

Is it possible to search a specific latitude and longitude in stac-server? I only saw the bbox and intersection search. Thanks