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

$ 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 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 Uvicorn
main commit ghcr.io/developmentseed/tipg:latest ghcr.io/developmentseed/tipg:uvicorn-latest
tags ghcr.io/developmentseed/tipg:0.0.0 ghcr.io/developmentseed/tipg:uvicorn-0.0.0
dockerfile /dockerfiles/Dockerfile.gunicorn /dockerfiles/Dockerfile.uvicorn

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

# Gunicorn image
$ docker run \
    -p 8081:8081 \
    -e PORT=8081 \
    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \
    ghcr.io/developmentseed/tipg:latest

# or Uvicorn image
$ docker run \
    -p 8081:8081 \
    -e PORT=8081 \
    -e DATABASE_URL=postgresql://username:password@0.0.0.0:5432/postgis \
    ghcr.io/developmentseed/tipg:uvicorn-latest

Note: If you are planning to use the docker image in a kubernetes deployment you may want to use the uvicorn image (ref: https://fastapi.tiangolo.com/deployment/server-workers/).

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-0.7.2.tar.gz (56.7 kB view details)

Uploaded Source

Built Distribution

tipg-0.7.2-py3-none-any.whl (77.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tipg-0.7.2.tar.gz
  • Upload date:
  • Size: 56.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for tipg-0.7.2.tar.gz
Algorithm Hash digest
SHA256 5f16229966e96d524842676903b212977dc7be81f585924c9a9d54639494f8c8
MD5 7ebd69d3f304888b35754243bd6d6026
BLAKE2b-256 15301b701a26e37b07469a8ed2ae5e023d64f5e4d173e82dd9663f69b06c2cca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tipg-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 77.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for tipg-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ce2e054d67e3c643e252d9b0c20acea6d063270a61c4bf09dc1418a03b3b5c0
MD5 4548a3e22d802dd4b6717a85d5d7b891
BLAKE2b-256 5536fa6e5cd8cb136de2d59b66eb246f6b87019f607d003cc25d2f5ce48852d5

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