easystac.planetary.image_collection.ImageCollection¶
- class easystac.planetary.image_collection.ImageCollection(collection)[source]¶
ImageCollection object for Planetary Computer.
This object mimics the Earth Engine filtering methods for ee.ImageCollection class and makes them available for the Planetary Computer STAC. Items signing is automatically done.
- Parameters
collection (str) – Collection name.
Examples
>>> import easystac.planetary as pc >>> from geojson import Point >>> pc.Authenticate() >>> pc.Initialize() >>> geom = Point([-76.1,4.3]) >>> S2 = (pc.ImageCollection("sentinel-2-l2a") .filterBounds(geom) .filterDate("2020-01-01","2021-01-01") .getInfo(resolution = 10))
Methods
filterDate(initialDate, finalDate)Initializes the initial and final date for datetime filtering.
filterBounds(geometry)Initializes the geometry for bounds filtering.
getInfo(**kwargs)Returns all the information from the STAC search.
- filterDate(initialDate, finalDate)¶
Initializes the initial and final date for datetime filtering.
- Parameters
initialDate (str) – Initial date in format %Y-%m-%d.
finalDate (str) – Final date in format %Y-%m-%d.
- Return type
BaseImageCollection
Examples
>>> import easystac.planetary as pc >>> pc.Authenticate() >>> pc.Initialize() >>> S2 = (pc.ImageCollection("sentinel-2-l2a") .filterDate("2020-01-01","2021-01-01"))
- filterBounds(geometry)¶
Initializes the geometry for bounds filtering.
- Parameters
geometry (dict) – GeoJSON object of dictionary-like object representing a GeoJSON.
- Return type
BaseImageCollection
Examples
>>> import easystac.planetary as pc >>> from geojson import Point >>> pc.Authenticate() >>> pc.Initialize() >>> geom = Point([-76.1,4.3]) >>> S2 = (pc.ImageCollection("sentinel-2-l2a") .filterBounds(geom))
- getInfo(**kwargs)[source]¶
Returns all the information from the STAC search.
- Parameters
**kwargs – Additional arguments passed to
stackstac.stack(). Some of them areepsg,resolution, andbbox.- Returns
Chunked DataArray with Dask.
- Return type
xarray.DataArray
Examples
>>> import easystac.planetary as pc >>> from geojson import Point >>> pc.Authenticate() >>> pc.Initialize() >>> geom = Point([-76.1,4.3]) >>> S2 = (pc.ImageCollection("sentinel-2-l2a") .filterBounds(geom) .filterDate("2020-01-01","2021-01-01") .getInfo(resolution = 10))