Giter Club home page Giter Club logo

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.

pyturf's Projects

pyturf icon pyturf

A modular geospatial engine written in python

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.