Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Turf | 7,985 | 1,180 | 496 | a month ago | 54 | July 10, 2021 | 279 | mit | JavaScript | |
A modular geospatial engine written in JavaScript | ||||||||||
Geo | 1,143 | 46 | 74 | 4 days ago | 21 | June 24, 2022 | 98 | other | Rust | |
Geospatial primitives and algorithms for Rust | ||||||||||
Geoos | 555 | 2 days ago | 22 | May 26, 2022 | 13 | lgpl-2.1 | Go | |||
A library provides spatial data and geometric algorithms | ||||||||||
Turf Swift | 195 | 20 | 3 months ago | 22 | August 11, 2022 | 22 | isc | Swift | ||
A Swift language port of Turf.js. | ||||||||||
Pytsp | 98 | 5 years ago | Python | |||||||
A 2D/3D visualization of the Traveling Salesman Problem main heuristics | ||||||||||
Polylabel Rs | 42 | 1 | 3 | 17 days ago | 32 | April 21, 2022 | 1 | mit | Rust | |
A Rust implementation of the Polylabel algorithm, with FFI. | ||||||||||
Olturf | 29 | a year ago | 11 | April 24, 2018 | 3 | mit | JavaScript | |||
A Turf toolbar for OpenLayers. | ||||||||||
Turf.jl | 24 | 9 months ago | 2 | mit | Julia | |||||
A Julia port of Turf.js http://turfjs.org/ | ||||||||||
De9im | 17 | a year ago | 2 | mit | JavaScript | |||||
DE-9IM spatial predicate library implemented in Javascript. | ||||||||||
Googlepolylines | 14 | 2 months ago | 18 | other | HTML | |||||
R package for encoding objects using Google's Polyline Encoding Algorithm |
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).
# get all of turf
npm install @turf/turf
# or get individual packages
npm install @turf/helpers
npm install @turf/buffer
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.
Ports of Turf.js are available in:
Turf for Swift is experimental and its public API is subject to change. Please use with care.
The Turf for Dart port is still in progress, the implementation status can be found in the README.
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:
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: {}
};
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:
@turf/*
robust-predicates
rbush
tinyqueue
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]