Skip to content

DHI/tipgstac

 
 

Repository files navigation

tipgstac

A PgSTAC Backend for TiPG.

Test License


Documentation:

Source Code: https://github.com/developmentseed/tipgstac


Create a simple STAC API using TiPg and PgSTAC database. The API should be OGC Features compliant (see: https://github.com/developmentseed/tipg#ogc-specifications)

Install

git clone https://github.com/developmentseed/tipgstac.git
cd tipgstac

python -m pip install -e .

Configuration

To be able to work, the application will need access to the database. tipgstac uses Starlette's configuration pattern, which makes use of environment variables or a .env file to pass variables to the application.

An example of a .env file can be found in .env.example

# you need to define the DATABASE_URL directly
DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis

PgSTAC Configuration

By default, pgstac does not have the context extension enabled (ability to return number of matched items). To enable this you'll need to access the database and run this:

INSERT INTO pgstac_settings (name, value)
VALUES ('context', 'on')
ON CONFLICT ON CONSTRAINT pgstac_settings_pkey DO UPDATE SET value = excluded.value;

Launch

$ pip install uvicorn

# Set your PostGIS database instance URL in the environment
$ export DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis
$ uvicorn tipgstac.main:app

# or using Docker

$ docker-compose up app

Contribution & Development

See CONTRIBUTING.md

License

See LICENSE

Authors

Created by Development Seed

Changes

See CHANGES.md.

Releases

No releases published

Packages

No packages published

Languages

  • Python 78.6%
  • HTML 17.2%
  • Shell 4.2%