Skip to content

Instantly share code, notes, and snippets.

@sixy6e
Last active February 23, 2021 04:31
Show Gist options
  • Save sixy6e/40e7c7be947c3993aad59b158b83a9dd to your computer and use it in GitHub Desktop.
Save sixy6e/40e7c7be947c3993aad59b158b83a9dd to your computer and use it in GitHub Desktop.
STAC demo
A demo that uses Python to do a little query against a STAC catalogue.
import requests
import json
from pprint import pprint
def main():
url = "https://earth-search.aws.element84.com/v0/search"
search = {
"bbox": [142.5, -33, 143, -32.5],
"datetime": "2021-01-01/2021-01-31",
"query": {"eo:cloud_cover": {"lt": "10"}},
"limit": 1,
}
response = requests.post(url, json=search, headers=None)
pprint(json.loads(response.text))
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment