Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation around ingesting data #565

Open
habibutsu opened this issue Apr 29, 2023 · 4 comments
Open

Improve documentation around ingesting data #565

habibutsu opened this issue Apr 29, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@habibutsu
Copy link

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
Copy link
Author

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 habibutsu changed the title How to create catalog and add items with assets to it How to create collection and add items with assets to it Apr 29, 2023
@habibutsu
Copy link
Author

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

@gadomski
Copy link
Member

gadomski commented May 1, 2023

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 gadomski added the documentation Improvements or additions to documentation label May 1, 2023
@gadomski gadomski changed the title How to create collection and add items with assets to it Improve documentation around ingesting data May 1, 2023
@jonhealy1
Copy link
Collaborator

We have created a cli tool here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants