Skip to main content

Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.

Project description

Simple and Fast Geospatial OGC Features and Tiles API for PostGIS.

Test Coverage Package version License


Documentation: https://developmentseed.org/tipg/

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


tipg, pronounced T[ee]pg, is a Python package that helps create lightweight OGC Features and Tiles API with a PostGIS Database backend. The API has been designed for OGC Features and OGC Tiles specifications.

Note This project is the result of the merge between tifeatures and timvt.

Install

python -m pip install pip -U
python -m pip install tipg

# or from source
git clone https://github.com/developmentseed/tipg.git
cd tipg
python -m pip install -e .

OGC Specifications

Specification Status link
OGC Common Part 1: Core https://docs.ogc.org/DRAFTS/19-072.html
OGC Common Part 2: Geospatial Data http://docs.ogc.org/DRAFTS/20-024.html
OGC Features Part 1: Core https://docs.ogc.org/is/17-069r4/17-069r4.html
OGC Features Part 2: CRS by Reference https://docs.ogc.org/is/18-058r1/18-058r1.html
OGC Features Part 3: Filtering / CQL2 https://docs.ogc.org/DRAFTS/19-079r1.html
OGC Tiles Part 1: Core https://docs.ogc.org/is/20-057/20-057.html

Notes:

We chose to avoid implementing the second part of the specification to prevent the introduction of CRS-based GeoJSON. We may review this decision in the future.

While we tried to follow OGC specifications to the letter, some API endpoints might have more capabilities (e.g., geometry column selection).

PostGIS/PostgreSQL

tipg relies greatly on PostGIS' ST_* functions. PostGIS must be installed on your PostgreSQL database.

SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%';
CREATE EXTENSION postgis;

Configuration

To be able to work, the application will need access to the database. tipg 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

More info about configuration options at https://developmentseed.org/tipg/user_guide/configuration/

Launch

# Set your PostGIS database instance URL in the environment
export DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis
uv run --group server uvicorn tipg.main:app

# or using Docker

docker-compose up app

Docker images

We are publishing two different docker images on tag and on every commit to main branch:

Gunicorn
main commit ghcr.io/developmentseed/tipg:latest
tags ghcr.io/developmentseed/tipg:X.X.X
dockerfile /dockerfiles/Dockerfile

See all version at https://github.com/developmentseed/tipg/pkgs/container/tipg

$ docker run \
    -p 8000:8000 \
    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \
    ghcr.io/developmentseed/tipg:latest \
    uvicorn tipg.main:app --host 0.0.0.0 --port 8000 --workers 1

# using Gunicorn
$ docker run \
    -p 8000:8000 \
    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \
    ghcr.io/developmentseed/tipg:latest \
    gunicorn -k uvicorn.workers.UvicornWorker tipg.main:app --bind 0.0.0.0:8000 --workers 1

Contribution & Development

See CONTRIBUTING.md

License

See LICENSE

Authors

Created by Development Seed

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

tipg-1.4.0.tar.gz (59.2 kB view details)

Uploaded Source

Built Distribution

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

tipg-1.4.0-py3-none-any.whl (88.8 kB view details)

Uploaded Python 3

File details

Details for the file tipg-1.4.0.tar.gz.

File metadata

  • Download URL: tipg-1.4.0.tar.gz
  • Upload date:
  • Size: 59.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for tipg-1.4.0.tar.gz
Algorithm Hash digest
SHA256 9530d46639bf6bbab90ebc246317d8bccde1c5231da07dd0bf5f34e69333ff14
MD5 e0f1f24f4dbdfa6c6e39f2e9bbbf19d5
BLAKE2b-256 c7a310efe0d7bdfcbcb374308ff52c97068b2bb9dc4974ad4515a404b125c90b

See more details on using hashes here.

Provenance

The following attestation bundles were made for tipg-1.4.0.tar.gz:

Publisher: release.yml on developmentseed/tipg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tipg-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: tipg-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 88.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for tipg-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09e9c038b69ead525e3f1ea399cd461743f852abdb7492e982f45626b37b6b03
MD5 30d43b230389aac4f902429657d7697a
BLAKE2b-256 e4b7578648fd5cd0c4cfd9051daf09e7d2e6c40587893ebcf41690785a182018

See more details on using hashes here.

Provenance

The following attestation bundles were made for tipg-1.4.0-py3-none-any.whl:

Publisher: release.yml on developmentseed/tipg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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