stac-fastapi icon indicating copy to clipboard operation
stac-fastapi copied to clipboard

Improve documentation around ingesting data

Open habibutsu opened this issue 1 year ago • 4 comments

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.

habibutsu avatar Apr 29 '23 09:04 habibutsu

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()
)

habibutsu avatar Apr 29 '23 10:04 habibutsu

I've found this issue in pystac-client. So, it's mean that there is only one way to create items - make requests manually.

habibutsu avatar Apr 29 '23 11:04 habibutsu

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.

gadomski avatar May 01 '23 12:05 gadomski

We have created a cli tool here

jonhealy1 avatar Apr 11 '24 16:04 jonhealy1