Creating STAC Items
makestac.py - Learn STAC Structure
from pystac.validation import validate_dict
import pystac
metadata = {
"type": "Feature",
"stac_version": "1.0.0",
"id": "example-item-001",
"properties": {
"datetime": "2020-01-01T12:00:00Z",
"start_datetime": "2020-01-01T12:00:00Z",
"end_datetime": "2020-02-01T12:00:00Z"
},
"geometry": {
"type": "Polygon",
"coordinates": [[[5.0, 51.0], [5.1, 51.0],
[5.1, 51.1], [5.0, 51.1],
[5.0, 51.0]]]
},
"bbox": [5.0, 51.0, 5.1, 51.1],
"assets": {
"data": {
"href": "https://example.org/data/example-item-001.tif",
"type": "image/tiff; application=geotiff",
"roles": ["data"]
}
}
}
validate_dict(metadata)
item = pystac.Item.from_dict(metadata)