The goal of this tutorial is to provide an overview to the STAC specification, a breakdown of each STAC component, and how they are integrated together.
What is STAC?¶
The Spatial Temporal Asset Catalog specification was designed to establish a standard, unified language to talk about geospatial data, allowing it to more easily searchable and queryable.
An overarching goal in having this common standard is to eliminate the need to puruse through APIs of many satellite providers in order to access all the needed data.
STAC is simple and extensible in its design due to how it is structured. STAC is a network of json files that reference other json files, with each json file adhering to a specific core specification depending on what STAC component it is describing. This core json format can also be customized to fit differing needs, making the STAC specification highly flexible and adaptable.
STAC Components¶
The four key components of STAC include items, catalogs, collections, and the STAC API. These components can be used in isolation from one another, but ideally work best in tandem.
STAC Item¶
A STAC item is the foundational building block of STAC. It is GeoJSON supplemented with additional metadata that enables clients to traverse through catalogs.
import pystac
print(pystac.Item.__doc__)
To learn more about STAC Item specifications: https://github.com/radiantearth/stac-spec/tree/master/item-spec
STAC Catalog¶
A Catalog is usually the starting point for navigating a STAC. A catalog.json file will contain contains links to some combination of other catalogs, collections, and/or items. This combination is quite variable and flexible depending on how the data is being organized. A catalog may only reference a group of items, it may link toother subcatalogsand no collections, or a combination of catalogs and collections, etc.
We can think of it like a directory tree on a computer.
STAC Catalog Relation and Media Types¶
Self: Absolute URL to where the given json file can be found online, if possible
Root: Root: URL to root catalog or collection
Parent: URL to a Parent STAC Specification (could be an item, catalog, collection)
Child: URL to a Child STAC Specification (item, catalog, collection)
print(pystac.Catalog.__doc__)
To learn more about STAC Catalog specifications: https://github.com/radiantearth/stac-spec/tree/master/catalog-spec
STAC Collection¶
A STAC Collection builds upon the STAC Catalog specification to include additional metadata about a set of items that exist as part of the collection.
print(pystac.Collection.__doc__)
To learn more about STAC Collection specifications: https://github.com/radiantearth/stac-spec/tree/master/collection-spec
Dynamic versus Static STAC Catalogs¶
STAC Catalogs can be static, by creating the json files and storing them either in local directories, on file servers, or stored on cloud services like Amazon Simple Storage Service (Amazon S3)or Google Cloud Storage.
This makes static STAC Catalogs highly portable, reliable, providing a solid foundation for building dynamic versions through the use of APIs.
STAC API¶
This leads us to STAC APIs, the last component of the STAC specification. A STAC API is a RESTful API specification for querying STAC catalogs in a dynamic way. It is designed with a standard set of endpoints for searching catalogs, collections, and items.
You can find details in the API specification here: https://github.com/radiantearth/stac-api-spec
Next Steps¶
In the next tutorial, we will demonstrate how to generate a simple, static STAC Catalog of some Planet imagery using PySTAC!