Skip to main content

SpatialTypes functions for extend PyPika with GIS

Project description

pypika-gis

SpatialTypes functions for extend PyPika with GIS.

Example

from pypika import Query
from pypika_gis import spatialtypes as st

query = Query.from_('field').select('id', st.AsGeoJSON('geom'))
print(str(query))
# SELECT "id",ST_AsGeoJSON('geom') FROM "field"

query = Query.from_('crop').select('id').where(st.Intersects('geom', st.SRID(st.MakePoint(10, 5), 4326)))
print(str(query))
# SELECT "id" FROM "crop" WHERE ST_Intersects('geom',ST_SRID(ST_MakePoint(10,5),4326))

Available functions

  • Envelope(ST_Envelope)
  • Extent(ST_Extent)
  • GeomFromGeoJSON(ST_GeomFromGeoJSON)
  • GeoHash(ST_GeoHash)
  • Intersection(ST_Intersection)
  • Intersects(ST_Intersects)
  • IsEmpty(ST_IsEmpty)
  • IsValid(ST_IsValid)
  • MakePoint(ST_MakePoint)
  • SetSRID(ST_SetSRID)
  • Within(ST_Within)
  • X(ST_X)
  • Y(ST_Y)
  • Z(ST_Z)

Dependencies

Setup

pip install pypika-gis

Development

Full tests and coverage

pip install -r requirements-dev.txt
python -m pytest --cov

Credits

pypika-gis is based on PyPika. Check their page for further query buider instructions, examples and more details about PyPika core.

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

pypika-gis-1.2.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

pypika_gis-1.2.0-py2.py3-none-any.whl (20.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pypika-gis-1.2.0.tar.gz.

File metadata

  • Download URL: pypika-gis-1.2.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Linux/5.0.3-arch1-1-ARCH

File hashes

Hashes for pypika-gis-1.2.0.tar.gz
Algorithm Hash digest
SHA256 65b9f99fad50c347c2b0219c968909907cd073a07754aeede7b5c1fe26e5f9cc
MD5 9437ecc9a1a0240f44f9b6aecb9b55b2
BLAKE2b-256 83638aca5ebf12cf5cad7fe4ebf5ce5207c50946363b0c5c176490e2082f4d2f

See more details on using hashes here.

File details

Details for the file pypika_gis-1.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pypika_gis-1.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.11 CPython/3.7.2 Linux/5.0.3-arch1-1-ARCH

File hashes

Hashes for pypika_gis-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6febd5f3daf97f0f6eb10efbb08784bad147b57be085df924fdcd26ebf41464e
MD5 c71cd0ffe96c6e8dd27df2d7e357f6e1
BLAKE2b-256 745ce2e04888b7a77ecb98d472fdd85249556c2119c051536526b812ab21e6d4

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