stac-fastapi
stac-fastapi copied to clipboard
Improve documentation around ingesting data
I run stac-catalog with using pgstac, but it is not clear for me how to use it.
My expectation that i can take pystac_client and create Collection with some Items, but I don't see such methods for that.
I've found this notebook, but it shows how to create static-catalog in file
Could you provide example how to create items.
I found this variant. Is it right approach?
import datetime as dt
from pystac import Collection,
collection = Collection(
id="test",
description="my first collection",
extent=Extent(
spatial=SpatialExtent(bboxes=[[-180, -90, 180, 90]]),
temporal=TemporalExtent(intervals=[
[dt.datetime(2016, 1, 1), dt.datetime(2022, 1, 1)]
])
))
r = requests.post(
"http://127.0.0.1:8080/collections",
json=collection.to_dict()
)
I've found this issue in pystac-client. So, it's mean that there is only one way to create items - make requests manually.
make requests manually.
Correct. Check out https://github.com/stac-utils/stac-fastapi/blob/main/scripts/ingest_joplin.py for an example of a script to load data into a database using stac-fastapi.
We could have better documentation around this process, so I'm going to keep this issue open and change its title to make it a tracking issue for the docs.
We have created a cli tool here