esciencecenter-digital-skills / geospatial-python

Introduction to Geospatial Raster and Vector Data with Python
https://esciencecenter-digital-skills.github.io/geospatial-python/
Other
3 stars 0 forks source link

Scenes to be used throughout the lesson #7

Closed fnattino closed 2 years ago

fnattino commented 2 years ago

Two candidate scenes to be used throughout the lesson are the following:

from pystac_client import Client
from shapely.geometry import Point

api_url = "https://earth-search.aws.element84.com/v0"

client = Client.open(api_url)

# collection: Sentinel-2, Level 2A, COGs
collection = "sentinel-s2-l2a-cogs"

# AMS, Dam square
p = Point(4.89, 52.37)

mysearch = client.search(
    collections=[collection],
    intersects=p,
    datetime="2020-03-26/2020-03-28",
    query=["eo:cloud_cover<10"]
)

items = mysearch.get_all_items()

items.save_object("search.json")

Previews:

Scene 1

Scene 2

The snippet above could be the basis for the new Episode 5 (on dataset access).

At the beginning of the following episodes, we could read in the search results as items = pystac.ItemCollection.from_file("search.json") and work with remote assets, downloading data only when needed. We would also need to link to somewhere in the setup where we describe how to modify the code if one wants to download data from Figshare and work with local files.

SarahAlidoost commented 2 years ago

@srmsoumya FYI.

rogerkuou commented 2 years ago

we have used the scenes. closing this issue