# pyturf
Read the [docs](https://pyturf.readthedocs.io/en/latest/)
![build_badge](https://github.com/pyturf/pyturf/workflows/build/badge.svg)
[![codecov](https://codecov.io/gh/pyturf/pyturf/branch/master/graph/badge.svg)](https://codecov.io/gh/pyturf/pyturf)
[![PyPI version](https://badge.fury.io/py/pyturf.svg)](https://badge.fury.io/py/pyturf)
[![Documentation Status](https://readthedocs.org/projects/ansicolortags/badge/?version=latest)](https://pyturf.readthedocs.io/?badge=latest)
`pyturf` is a powerful geospatial library written in python, based on [turf.js](https://github.com/Turfjs/turf),
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](https://geojson.org/) 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.
```python
# 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:
```python
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](https://github.com/pyturf/pyturf/tree/master/turf/along)
- [area](https://github.com/pyturf/pyturf/tree/master/turf/area)
- [bbox](https://github.com/pyturf/pyturf/tree/master/turf/bbox)
- [bbox-polygon](https://github.com/pyturf/pyturf/tree/master/turf/bbox_polygon)
- [bearing](https://github.com/pyturf/pyturf/tree/master/turf/bearing)
- [boolean-disjoint](https://github.com/pyturf/pyturf/tree/master/turf/boolean_disjoint)
- [boolean-intersects](https://github.com/pyturf/pyturf/tree/master/turf/boolean_intersects)
- [boolean-point-in-polygon](https://github.com/pyturf/pyturf/tree/master/turf/boolean_point_in_polygon)
- [boolean-point-on-line](https://github.com/pyturf/pyturf/tree/master/turf/boolean_point_on_line)
- [boolean-within](https://github.com/pyturf/pyturf/tree/master/turf/boolean_within)
- [center](https://github.com/pyturf/pyturf/tree/master/turf/center)
- [centroid](https://github.com/pyturf/pyturf/tree/master/turf/centroid)
- [destination](https://github.com/pyturf/pyturf/tree/master/turf/destination)
- [distance](https://github.com/pyturf/pyturf/tree/master/turf/distance)
- [envelope](https://github.com/pyturf/pyturf/tree/master/turf/envelope)
- [explode](https://github.com/pyturf/pyturf/tree/master/turf/explode)
- [great circle](https://github.com/pyturf/pyturf/tree/master/turf/great_circle)
- [helpers](https://github.com/pyturf/pyturf/tree/master/turf/helpers)
- [hex_grid](https://github.com/pyturf/pyturf/tree/master/turf/hex_grid)
- [length](https://github.com/pyturf/pyturf/tree/master/turf/length)
- [line-intersect](https://github.com/pyturf/pyturf/tree/master/turf/line_intersect)
- [midpoint](https://github.com/pyturf/pyturf/tree/master/turf/midpoint)
- [nearest-point](https://github.com/pyturf/pyturf/tree/master/turf/nearest_point)
- [point-grid](https://github.com/pyturf/pyturf/tree/master/turf/point_grid)
- [point-on-feature](https://github.com/pyturf/pyturf/tree/master/turf/point_on_feature)
- [point-to-line-distance](https://github.com/pyturf/pyturf/tree/master/turf/point_to_line_distance)
- [polygon-tangents](https://github.com/pyturf/pyturf/tree/master/turf/polygon_tangents)
- [polygon-to-line](https://github.com/pyturf/pyturf/tree/master/turf/polygon_to_line)
- [rectangle-grid](https://github.com/pyturf/pyturf/tree/master/turf/rectangle_grid)
- [rhumb-bearing](https://github.com/pyturf/pyturf/tree/master/turf/rhumb_bearing)
- [rhumb-destination](https://github.com/pyturf/pyturf/tree/master/turf/rhumb_destination)
- [rhumb-distance](https://github.com/pyturf/pyturf/tree/master/turf/rhumb_distance)
- [square](https://github.com/pyturf/pyturf/tree/master/turf/square)
- [square-grid](https://github.com/pyturf/pyturf/tree/master/turf/square_grid)
- [triangle-grid](https://github.com/pyturf/pyturf/tree/master/turf/triangle_grid)
## Contributing
This library is a work in progress, so pull requests from the community are welcome!
Check out [CONTRIBUTING.md](https://github.com/pyturf/pyturf/blob/master/CONTRIBUTING.md) for a detailed explanation on how to contribute.
Raw data
{
"_id": null,
"home_page": "https://github.com/pyturf/pyturf",
"name": "pyturf",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.5",
"maintainer_email": "",
"keywords": "geospatial,geo",
"author": "Diogo Matos Chaves, Steffen H\u00e4u\u00dfler",
"author_email": "di.matoschaves@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c1/d2/78f0ba1832b4e2b18de26924b6f9c354f6fa72d6c00465f1a0106aa7d721/pyturf-0.6.10.tar.gz",
"platform": null,
"description": "# pyturf\n\nRead the [docs](https://pyturf.readthedocs.io/en/latest/)\n\n![build_badge](https://github.com/pyturf/pyturf/workflows/build/badge.svg)\n[![codecov](https://codecov.io/gh/pyturf/pyturf/branch/master/graph/badge.svg)](https://codecov.io/gh/pyturf/pyturf)\n[![PyPI version](https://badge.fury.io/py/pyturf.svg)](https://badge.fury.io/py/pyturf)\n[![Documentation Status](https://readthedocs.org/projects/ansicolortags/badge/?version=latest)](https://pyturf.readthedocs.io/?badge=latest)\n\n`pyturf` is a powerful geospatial library written in python, based on [turf.js](https://github.com/Turfjs/turf),\na popular library written in javascript. It follows the same modular structure and maintains the same functionality as the original\nmodules in that library for maximum compatibility.\n\nIt includes traditional geospatial operations, as well as helper functions for creating and manipulating\n[GeoJSON](https://geojson.org/) data.\n\n## Installation\n\n```\n$ pip install pyturf\n```\n\n## Usage\n\nMost `pyturf` modules expect as input GeoJSON features or a collection of these, which can be the following:\n\n- Point / MultiPoint\n- LineString / MultiLineString\n- Polygon / MultiPolygon\n\nThese can either be defined as a python dictionary or as objects from `pyturf` helper classes.\n\n```python\n# example as a dictionary:\n\npoint1 = {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Point\",\n # Note order: longitude, latitude.\n \"coordinates\": [-73.988214, 40.749128]\n }\n}\n\n...\n\n# Example using objects from helper classes\n\nfrom turf import point\n\n# Note order: longitude, latitude.\npoint1 = point([-73.988214, 40.749128])\n\n```\n\nIn order to use the modules, one can import directly from `pyturf`, such as:\n\n```python\nfrom turf import distance, point\n\npoint1 = point([-73.988214, 40.749128])\npoint2 = point([-73.838432, 40.738484])\n\ndist = distance(point1, point2, {\"units\": \"miles\"})\n```\n\n## Available Modules\n\nCurrently, the following modules have been implemented:\n\n- [along](https://github.com/pyturf/pyturf/tree/master/turf/along)\n- [area](https://github.com/pyturf/pyturf/tree/master/turf/area)\n- [bbox](https://github.com/pyturf/pyturf/tree/master/turf/bbox)\n- [bbox-polygon](https://github.com/pyturf/pyturf/tree/master/turf/bbox_polygon)\n- [bearing](https://github.com/pyturf/pyturf/tree/master/turf/bearing)\n- [boolean-disjoint](https://github.com/pyturf/pyturf/tree/master/turf/boolean_disjoint)\n- [boolean-intersects](https://github.com/pyturf/pyturf/tree/master/turf/boolean_intersects)\n- [boolean-point-in-polygon](https://github.com/pyturf/pyturf/tree/master/turf/boolean_point_in_polygon)\n- [boolean-point-on-line](https://github.com/pyturf/pyturf/tree/master/turf/boolean_point_on_line)\n- [boolean-within](https://github.com/pyturf/pyturf/tree/master/turf/boolean_within)\n- [center](https://github.com/pyturf/pyturf/tree/master/turf/center)\n- [centroid](https://github.com/pyturf/pyturf/tree/master/turf/centroid)\n- [destination](https://github.com/pyturf/pyturf/tree/master/turf/destination)\n- [distance](https://github.com/pyturf/pyturf/tree/master/turf/distance)\n- [envelope](https://github.com/pyturf/pyturf/tree/master/turf/envelope)\n- [explode](https://github.com/pyturf/pyturf/tree/master/turf/explode)\n- [great circle](https://github.com/pyturf/pyturf/tree/master/turf/great_circle)\n- [helpers](https://github.com/pyturf/pyturf/tree/master/turf/helpers)\n- [hex_grid](https://github.com/pyturf/pyturf/tree/master/turf/hex_grid)\n- [length](https://github.com/pyturf/pyturf/tree/master/turf/length)\n- [line-intersect](https://github.com/pyturf/pyturf/tree/master/turf/line_intersect)\n- [midpoint](https://github.com/pyturf/pyturf/tree/master/turf/midpoint)\n- [nearest-point](https://github.com/pyturf/pyturf/tree/master/turf/nearest_point)\n- [point-grid](https://github.com/pyturf/pyturf/tree/master/turf/point_grid)\n- [point-on-feature](https://github.com/pyturf/pyturf/tree/master/turf/point_on_feature)\n- [point-to-line-distance](https://github.com/pyturf/pyturf/tree/master/turf/point_to_line_distance)\n- [polygon-tangents](https://github.com/pyturf/pyturf/tree/master/turf/polygon_tangents)\n- [polygon-to-line](https://github.com/pyturf/pyturf/tree/master/turf/polygon_to_line)\n- [rectangle-grid](https://github.com/pyturf/pyturf/tree/master/turf/rectangle_grid)\n- [rhumb-bearing](https://github.com/pyturf/pyturf/tree/master/turf/rhumb_bearing)\n- [rhumb-destination](https://github.com/pyturf/pyturf/tree/master/turf/rhumb_destination)\n- [rhumb-distance](https://github.com/pyturf/pyturf/tree/master/turf/rhumb_distance)\n- [square](https://github.com/pyturf/pyturf/tree/master/turf/square)\n- [square-grid](https://github.com/pyturf/pyturf/tree/master/turf/square_grid)\n- [triangle-grid](https://github.com/pyturf/pyturf/tree/master/turf/triangle_grid)\n\n## Contributing\n\nThis library is a work in progress, so pull requests from the community are welcome!\n\nCheck out [CONTRIBUTING.md](https://github.com/pyturf/pyturf/blob/master/CONTRIBUTING.md) for a detailed explanation on how to contribute.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Python geospatial library",
"version": "0.6.10",
"project_urls": {
"Homepage": "https://github.com/pyturf/pyturf"
},
"split_keywords": [
"geospatial",
"geo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c1d278f0ba1832b4e2b18de26924b6f9c354f6fa72d6c00465f1a0106aa7d721",
"md5": "02bc0cd922a068772bd6a880546d0e97",
"sha256": "8a977d99c494e805e334c541f004468b1e0c8dd39cb2464df1989fbc758341e6"
},
"downloads": -1,
"filename": "pyturf-0.6.10.tar.gz",
"has_sig": false,
"md5_digest": "02bc0cd922a068772bd6a880546d0e97",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 36570,
"upload_time": "2024-02-09T16:15:26",
"upload_time_iso_8601": "2024-02-09T16:15:26.843527Z",
"url": "https://files.pythonhosted.org/packages/c1/d2/78f0ba1832b4e2b18de26924b6f9c354f6fa72d6c00465f1a0106aa7d721/pyturf-0.6.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-09 16:15:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pyturf",
"github_project": "pyturf",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "rtree",
"specs": [
[
"==",
"1.0.0"
]
]
}
],
"lcname": "pyturf"
}