A modular geospatial engine written in JavaScript
Alternatives To Turf
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Turf7,9851,180496a month ago54July 10, 2021279mitJavaScript
A modular geospatial engine written in JavaScript
Geo1,14346744 days ago21June 24, 202298otherRust
Geospatial primitives and algorithms for Rust
2 days ago22May 26, 202213lgpl-2.1Go
A library provides spatial data and geometric algorithms
Turf Swift195
203 months ago22August 11, 202222iscSwift
A Swift language port of Turf.js.
5 years agoPython
A 2D/3D visualization of the Traveling Salesman Problem main heuristics
Polylabel Rs421317 days ago32April 21, 20221mitRust
A Rust implementation of the Polylabel algorithm, with FFI.
a year ago11April 24, 20183mitJavaScript
A Turf toolbar for OpenLayers.
9 months ago2mitJulia
A Julia port of Turf.js http://turfjs.org/
a year ago2mitJavaScript
DE-9IM spatial predicate library implemented in Javascript.
2 months ago18otherHTML
R package for encoding objects using Google's Polyline Encoding Algorithm
Alternatives To Turf
Select To Compare

Alternative Project Comparisons


GitHub Actions Status Version Badge Gitter chat Backers on Open Collective Sponsors on Open Collective Coverage Status

A modular geospatial engine written in JavaScript


Turf is a JavaScript library for spatial analysis. It includes traditional spatial operations, helper functions for creating GeoJSON data, and data classification and statistics tools. Turf can be added to your website as a client-side plugin, or you can run Turf server-side with Node.js (see below).


In Node.js

# get all of turf
npm install @turf/turf

# or get individual packages
npm install @turf/helpers
npm install @turf/buffer

In browser

Download the minified file, and include it in a script tag. This will expose a global variable named turf.

<script src="turf.min.js" charset="utf-8"></script>

You can also include it directly from a CDN:

<script src="https://cdn.jsdelivr.net/npm/@turf/[email protected]/turf.min.js"></script>


TypeScript definitions are packaged with each module. No DefinitelyTyped packages required.

Other languages

Ports of Turf.js are available in:

  • Java (Android, Java SE)
  • Swift (iOS, macOS, tvOS, watchOS, Linux)
    • Turf for Swift is experimental and its public API is subject to change. Please use with care.

  • Dart/Flutter (Dart Web, Dart Native; Flutter for iOS, Android, macOS, Windows, Linux, Web)
    • The Turf for Dart port is still in progress, the implementation status can be found in the README.

Data in Turf

Turf uses GeoJSON for all geographic data. Turf expects the data to be standard WGS84 longitude, latitude coordinates. Check out geojson.io for a tool to easily create this data.

NOTE: Turf expects data in (longitude, latitude) order per the GeoJSON standard.

Most Turf functions work with GeoJSON features. These are pieces of data that represent a collection of properties (ie: population, elevation, zipcode, etc.) along with a geometry. GeoJSON has several geometry types such as:

  • Point
  • LineString
  • Polygon

Turf provides a few geometry functions of its own. These are nothing more than simple (and optional) wrappers that output plain old GeoJSON. For example, these two methods of creating a point are functionally equivalent:

// Note order: longitude, latitude.
var point1 = turf.point([-73.988214, 40.749128]);

var point2 = {
  type: 'Feature',
  geometry: {
    type: 'Point',
    // Note order: longitude, latitude.
    coordinates: [-73.988214, 40.749128]
  properties: {}

Browser support

Turf packages are compiled to target ES2017. However, the browser version of @turf/turf is transpiled to also include support for IE11. If you are using these packages and need to target IE11, please transpile the following packages as part of your build:



This project exists thanks to all the people who contribute. If you are interested in helping, check out the Contributing Guide.


Thank you to all our backers! [Become a backer]


Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Popular Algorithms Projects
Popular Gis Projects
Popular Computer Science Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Computational Geometry