Skip to main content

pyturf

Read the docs

build_badge codecov PyPI version Documentation Status

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:

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.

Release files for pyturf 0.6.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyturf 0.6.14
File Size Uploaded
pyturf-0.6.14.tar.gz 261.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyturf 0.6.14
File Interpreter ABI Platform
pyturf-0.6.14-py3-none-any.whl Python 3 none any Details

Total release size: 728.2 kB

Release files / pyturf-0.6.14.tar.gz

Download URL pyturf-0.6.14.tar.gz
Size 261.1 kB
Tags Source
SHA-256 checksum
How to use checksums
45c973011fb0831d4103ca08b8b74254054a839a1a5c3279cb3b2f1be45c1ead
BLAKE2b-256 checksum
How to use checksums
8984d6ed1bd20356cd3986148d4110b68ab5b7ddad602afd26598393a872ec54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 13, 2025.

Transparency log

Release files / pyturf-0.6.14-py3-none-any.whl

Download URL pyturf-0.6.14-py3-none-any.whl
Size 467.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75a6e56cdb362f2f4ba05051d9d80c0db9e31f9aaabe0463139569b194099cb0
BLAKE2b-256 checksum
How to use checksums
2ceb341b9eeb4328a9760b235198d0683eaeecc0978ac93fe7b60c5aa85a3d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 13, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.14 This release

2 release files

0.6.10

1 release file

0.6.9

1 release file

0.6.7

1 release file

0.6.5

1 release file

0.6.4

1 release file

0.6.3

1 release file

0.6.2

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.12

1 release file

0.4.10

1 release file

0.4.7

1 release file

0.4.6

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.5

1 release file

0.2

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page