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:

We recommand using uv as project manager for development.

See https://docs.astral.sh/uv/getting-started/installation/ for installation

git clone https://github.com/stac-utils/titiler-pgstac.git
cd titiler-pgstac

uv sync --extra psycopg 

PgSTAC version

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

In theory, pgstac version >=0.3.4 should be supported by titiler-pgstac but old version might fail or require old Postgres version (see https://github.com/stac-utils/titiler-pgstac/issues/252).

Here are the versions officially (tested) supported:

titiler-pgstac Version pgstac
<1.0 >=0.7,<0.8
>=1.0,<2.1 >=0.8,<0.10
>=2.1 >=0.9,<0.10

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:

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

Launch

You'll need to have PGUSER, PGPASSWORD, PGDATABASE, PGHOST, PGPORT variables set in your environment pointing to your Postgres database where pgstac has been installed.

export PGUSER=username
export PGPASSWORD=password
export PGDATABASE=postgis
export PGHOST=database
export PGPORT=5432
$ python -m 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
# or
$ 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-2.1.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

titiler_pgstac-2.1.0-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

Details for the file titiler_pgstac-2.1.0.tar.gz.

File metadata

  • Download URL: titiler_pgstac-2.1.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for titiler_pgstac-2.1.0.tar.gz
Algorithm Hash digest
SHA256 2a9b702cd4621eb1f4b45b2093421f786913862afd2e2f58a38a74b487748ebc
MD5 5e07da6c8a14368c3174264d10e6558d
BLAKE2b-256 f6c22a8e3f3b09babb99119a48061b7cdf8b271c39d8272faa679dd6b22025d0

See more details on using hashes here.

File details

Details for the file titiler_pgstac-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: titiler_pgstac-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 42.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for titiler_pgstac-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0da006d699141fe41946e80faedc642d3b291605438d10e13800f62f1cd5a4ec
MD5 0de2764b006fd9a783859167b6a49dcf
BLAKE2b-256 01db1053af7bc4c6750a1173ac603ddd06300606518bd415adc21e03928f2812

See more details on using hashes here.

Supported by

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