Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # What is the minimum required to make a valid pystac.Item?
- import datetime
- import pystac
- year = 1999
- asset_id = f'USGS/GAP/CONUS/{year}'
- bbox = [-160.26, 18.85, -154.66, 22.29]
- start = datetime.datetime(year, 1, 2)
- item = pystac.Item(
- id=asset_id, geometry=None, bbox=bbox, datetime=start, properties={})
- item.set_self_href(URL_TEMPLATE % year)
- print(item)
- import pprint
- pprint.pprint(item_dict)
- item.validate() # boom
- item_dict = item.to_dict()
- pystac.validation.validate_dict(item_dict) # boom
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement