/pc-mini

A small clone of Planetary Computer items, served with stac-fastapi, browsable with stac-browser, backed by pgstac

Primary LanguageShell

pc-mini

A small clone of Planetary Computer STAC collections and items, loaded into a pgstac database, served with stac-fastapi.

Screenshot

Usage

Build then start the servers with docker-compose:

docker-compose build
docker-compose up

The first time you bring the services up, all the data will be ingested, which will take a little while.

The STAC server will be available on http://localhost:7822. A stac-browser will be available on http://localhost:7823. If you want to connect to the database directly, it is on http://localhost:7824.

Updating the STAC collections and items

Install the necessary requirements:

pip install -r requirements.txt

Then use the provided script:

scripts/update.py

This will update the files in the data directory.

Re-ingesting

Because ingestion takes a while, it's only run if the database is empty. To re-ingest the data, remove the database volume:

docker-compose down -v

The next time you run docker-compose up, the data will be re-ingested.

Manual ingestion

If you'd like to ingest the data into another pgstac instance, you can run the ingestion script manually, substituting your own connection parameters:

scripts/ingest.sh data postgresql://username:password@localhost:7824/postgis

Contributing

Install the dev requirements:

pip install -r requirements-dev.txt

Then, install the pre-commit hooks:

pre-commit install