A modular geospatial engine written in python
Project description
pyturf
Read the docs
pyturf
is a powerful geospatial library written in python, based on turf.js,
a popular library written in javascript. It follows the same modular structure and maintains the same functionality as the original
modules in that library for maximum compatibility.
It includes traditional geospatial operations, as well as helper functions for creating and manipulating GeoJSON data.
Installation
$ pip install pyturf
Usage
Most pyturf
modules expect as input GeoJSON features or a collection of these, which can be the following:
- Point / MultiPoint
- LineString / MultiLineString
- Polygon / MultiPolygon
These can either be defined as a python dictionary or as objects from pyturf
helper classes.
# example as a dictionary:
point1 = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
# Note order: longitude, latitude.
"coordinates": [-73.988214, 40.749128]
}
}
...
# Example using objects from helper classes
from turf import point
# Note order: longitude, latitude.
point1 = point([-73.988214, 40.749128])
In order to use the modules, one can import directly from pyturf
, such as:
from turf import distance, point
point1 = point([-73.988214, 40.749128])
point2 = point([-73.838432, 40.738484])
dist = distance(point1, point2, {"units": "miles"})
Available Modules
Currently, the following modules have been implemented:
- along
- area
- bbox
- bbox-polygon
- bearing
- boolean-disjoint
- boolean-intersects
- boolean-point-in-polygon
- boolean-point-on-line
- boolean-within
- center
- centroid
- circle
- destination
- distance
- envelope
- explode
- great circle
- helpers
- hex_grid
- length
- line-intersect
- midpoint
- nearest-point
- point-grid
- point-on-feature
- point-to-line-distance
- polygon-tangents
- polygon-to-line
- rectangle-grid
- rhumb-bearing
- rhumb-destination
- rhumb-distance
- square
- square-grid
- triangle-grid
Contributing
This library is a work in progress, so pull requests from the community are welcome!
Check out CONTRIBUTING.md for a detailed explanation on how to contribute.
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
Built Distribution
File details
Details for the file pyturf-0.6.14.tar.gz
.
File metadata
- Download URL: pyturf-0.6.14.tar.gz
- Upload date:
- Size: 261.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
45c973011fb0831d4103ca08b8b74254054a839a1a5c3279cb3b2f1be45c1ead
|
|
MD5 |
e28f99bfcafa3037729f85e828ed1829
|
|
BLAKE2b-256 |
8984d6ed1bd20356cd3986148d4110b68ab5b7ddad602afd26598393a872ec54
|
Provenance
The following attestation bundles were made for pyturf-0.6.14.tar.gz
:
Publisher:
pythonpublish.yml
on pyturf/pyturf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pyturf-0.6.14.tar.gz
-
Subject digest:
45c973011fb0831d4103ca08b8b74254054a839a1a5c3279cb3b2f1be45c1ead
- Sigstore transparency entry: 171094544
- Sigstore integration time:
-
Permalink:
pyturf/pyturf@12ef66dfd35920299075d632b62a9cbcdddc3471
-
Branch / Tag:
refs/tags/0.6.14
- Owner: https://github.com/pyturf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
pythonpublish.yml@12ef66dfd35920299075d632b62a9cbcdddc3471
-
Trigger Event:
release
-
Statement type:
File details
Details for the file pyturf-0.6.14-py3-none-any.whl
.
File metadata
- Download URL: pyturf-0.6.14-py3-none-any.whl
- Upload date:
- Size: 467.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
75a6e56cdb362f2f4ba05051d9d80c0db9e31f9aaabe0463139569b194099cb0
|
|
MD5 |
704ae5d111dead2fab09be36b24db5a9
|
|
BLAKE2b-256 |
2ceb341b9eeb4328a9760b235198d0683eaeecc0978ac93fe7b60c5aa85a3d3c
|
Provenance
The following attestation bundles were made for pyturf-0.6.14-py3-none-any.whl
:
Publisher:
pythonpublish.yml
on pyturf/pyturf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
pyturf-0.6.14-py3-none-any.whl
-
Subject digest:
75a6e56cdb362f2f4ba05051d9d80c0db9e31f9aaabe0463139569b194099cb0
- Sigstore transparency entry: 171094546
- Sigstore integration time:
-
Permalink:
pyturf/pyturf@12ef66dfd35920299075d632b62a9cbcdddc3471
-
Branch / Tag:
refs/tags/0.6.14
- Owner: https://github.com/pyturf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
pythonpublish.yml@12ef66dfd35920299075d632b62a9cbcdddc3471
-
Trigger Event:
release
-
Statement type: