Skip to main content

Connect PgSTAC and TiTiler.

Project description

Connect PgSTAC and TiTiler.

Test Coverage Package version License


Documentation: https://stac-utils.github.io/titiler-pgstac/

Source Code: https://github.com/stac-utils/titiler-pgstac


TiTiler-PgSTAC is a TiTiler extension that connects to a PgSTAC database to create dynamic mosaics based on search queries.

Installation

To install from PyPI and run:

# Make sure to have pip up to date
$ python -m pip install -U pip

# Install `psycopg` or `psycopg["binary"]` or `psycopg["c"]`
$ python -m pip install psycopg["binary"]

$ python -m pip install titiler.pgstac

To install from sources and run for development:

$ git clone https://github.com/stac-utils/titiler-pgstac.git
$ cd titiler-pgstac
$ python -m pip install -e .

PgSTAC version

titiler.pgstac depends on pgstac >=0.3.4 (https://github.com/stac-utils/pgstac/blob/main/CHANGELOG.md#v034).

psycopg requirement

titiler.pgstac depends on the psycopg library. Because there are three ways of installing this package (psycopg or , psycopg["c"], psycopg["binary"]), the user must install this separately from titiler.pgstac.

  • psycopg: no wheel, pure python implementation. It requires the libpq installed in the system.
  • psycopg["binary"]: binary wheel distribution (shipped with libpq) of the psycopg package and is simpler for development. It requires development packages installed on the client machine.
  • psycopg["c"]: a C (faster) implementation of the libpq wrapper. It requires the libpq installed in the system.

psycopg[c] or psycopg are generally recommended for production use.

In titiler.pgstac setup.py, we have added three options to let users choose which psycopg install to use:

  • pip install titiler.pgstac["psycopg"]: pure python
  • pip install titiler.pgstac["psycopg-c"]: use the C wrapper (requires development packages installed on the client machine)
  • pip install titiler.pgstac["psycopg-binary"]: binary wheels

Launch

You'll need to have POSTGRES_USER, POSTGRES_PASS, POSTGRES_DBNAME, POSTGRES_HOST, POSTGRES_PORT variables set in your environment pointing to your Postgres database where pgstac has been installed.

export POSTGRES_USER=username
export POSTGRES_PASS=password
export POSTGRES_DBNAME=postgis
export POSTGRES_HOST=database
export POSTGRES_PORT=5432
$ pip install uvicorn
$ uvicorn titiler.pgstac.main:app --reload

Using Docker

$ git clone https://github.com/stac-utils/titiler-pgstac.git
$ cd titiler-pgstac
$ docker-compose up --build tiler

It runs titiler.pgstac using Gunicorn web server. To run Uvicorn based version:

$ docker-compose up --build tiler-uvicorn

Contribution & Development

See CONTRIBUTING.md

License

See LICENSE

Authors

See contributors for a listing of individual contributors.

Changes

See CHANGES.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

titiler.pgstac-1.0.0a0.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

titiler.pgstac-1.0.0a0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file titiler.pgstac-1.0.0a0.tar.gz.

File metadata

  • Download URL: titiler.pgstac-1.0.0a0.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for titiler.pgstac-1.0.0a0.tar.gz
Algorithm Hash digest
SHA256 523c6dc20bcdff05c232e6d64bda3432114abd8d0a2cfae3d5df3bc2c6a8a72f
MD5 7495624ba08fda4e86062a2b6f44e1e1
BLAKE2b-256 1b4167cdc104abafbd457b4682038a5dba7a6079c58b5837fab777960997ccb8

See more details on using hashes here.

File details

Details for the file titiler.pgstac-1.0.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for titiler.pgstac-1.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 05e925794809838466243c95bf94e5626e3ada4a0bb6e05f48ff6f67bcb30a8d
MD5 4ad9529039f83028d18a7b42e999a8ca
BLAKE2b-256 b6df6f532706f62aba7ec49e7efba476a35b41cbeb7eb3de00b09bc373da7d66

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page