def make_item() -> pystac.Item: asset_id = "USGS/GAP/CONUS/2011" start = datetime.datetime(2011, 1, 2) item = pystac.Item(id=asset_id, geometry=None, bbox=None, datetime=start, properties={}) item.set_self_href(URL_TEMPLATE % 2011) ScientificExtension.add_to(item) return item
def make_collection() -> pystac.Collection: asset_id = "my/thing" start = datetime.datetime(2018, 8, 24) end = start + datetime.timedelta(5, 4, 3, 2, 1) bboxes = [[-180.0, -90.0, 180.0, 90.0]] spatial_extent = pystac.SpatialExtent(bboxes) intervals: List[List[Optional[datetime.datetime]]] = [[start, end]] temporal_extent = pystac.TemporalExtent(intervals) extent = pystac.Extent(spatial_extent, temporal_extent) collection = pystac.Collection(asset_id, "desc", extent) collection.set_self_href(URL_TEMPLATE % 2019) ScientificExtension.add_to(collection) return collection