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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b9f99fad50c347c2b0219c968909907cd073a07754aeede7b5c1fe26e5f9cc
|
|
| MD5 |
9437ecc9a1a0240f44f9b6aecb9b55b2
|
|
| BLAKE2b-256 |
83638aca5ebf12cf5cad7fe4ebf5ce5207c50946363b0c5c176490e2082f4d2f
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6febd5f3daf97f0f6eb10efbb08784bad147b57be085df924fdcd26ebf41464e
|
|
| MD5 |
c71cd0ffe96c6e8dd27df2d7e357f6e1
|
|
| BLAKE2b-256 |
745ce2e04888b7a77ecb98d472fdd85249556c2119c051536526b812ab21e6d4
|