3.0.14 • Published 6 years ago

turf v3.0.14

Weekly downloads
12,045
License
MIT
Repository
github
Last release
6 years ago

turf

Version Badge Travis CI Gitter chat Backers on Open Collective Sponsors on Open Collective Coverage Status Greenkeeper badge

A modular geospatial engine written in JavaScript

turfjs.org


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).

Installation

In Node.js

npm install @turf/turf

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/turf@5/turf.min.js"></script>

You can create light-weight turf builds with only the functions you need using the turfjs-builder UI or using browserify as described below.

Browserify

All of Turf's functions can also be installed as separate modules. This works well with tools like browserify where you want to install only the code you need. It also allows you to mix and match modules. This is the recommended usage pattern for most production environments. For example, to install the point and buffer modules use:

npm install @turf/helpers @turf/buffer

Bower NOTE: Bower support has been dropped Jan 1st 2017

Not recommended. Please don't use Bower. Use Browserify, Webpack, or the CDN instead.

TypeScript

TypeScript is supported internally within each module, no installs required.

Other languages

Ports of Turf.js are available in:


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: {}
};

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

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

Sponsors

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

formbird-nodered@lambda-platform/-dataformvivo-gismap2lyw-test-bos-geo@infinitebrahmanuniverse/nolb-tur@cloud-app-dev/micro-components@everything-registry/sub-chunk-2986earth3ddw_threeboxopenride-serveropenseadragon-annotations-cellmarkerosm2geojson-polygonosmlint-helperosm2x3doveny2nsc-earthnsc-olmixologymicro-ly-componentsnode-red-contrib-turfjsparcel-gridderopenlayermaplxpolygon-city-clipolygon-city-cli-multipacktesnode-geojson-gridreact-maptalks-toolshelimapgeotoolgeotypegeomorphgeo-find-close-polylinesgeojson3dgago-react-glhoodsfences-slicerfinnish-aipgjvgissbss_pluggis_gaud_testgisckds_cxlatlon2countryidlyisodistintroturfm2pmaptalks-toolsmapbox-draw-expandmapboxgl-measure-toollmapnew-micro-componentsmaha-geographical-accessibility-components-tempreact-webmaprhom-feature-servicerhom-route-matchrhom-route-matcherreact-leaflet-markers-in-polygonreact-leaflet-box-select-measurementreact-leaflet-box-select-measurement-privateqlqz-framesbss_cgfxtile-makertilemantlethreebox-dwthreeboxlythreeboxnpmtorpedosoonmapsnap-app-modelsdashboard-module-sdk@npmmatrix/matrixscript@lambda-platform/dataform@lambda-platform/lambda-builder@lambda-platform/lambda-vue@lambda-platform/public-vue-builder@formbird/nodesseattle-boundariesseattle-boundaries-datastacker-of-worlds@sipsdwangs/sonemapturf-runnerturf-cliturf-jsdocturf-bathwaterts-aerodata-france@supermap/react-iclient-mapboxgl@triedeti/threedigitaltwin@wbiokr/directives@wbiokr/geowenchmyviewwhzbcx_bimwhzbcx_web_appwhzbcx_web_app1whzbcx_web_plugxmgissupermaptemplatexw-soonmapapp-modelsvue-softpro-ui@zenview/micro-componentswebsbss
7.0.0-alpha.1

6 years ago

3.0.14

8 years ago

3.0.13

8 years ago

3.0.12

8 years ago

3.0.11

8 years ago

3.0.10

8 years ago

3.0.9

8 years ago

3.0.7

8 years ago

3.0.6

8 years ago

3.0.5

8 years ago

3.0.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.4.0

9 years ago

1.3.5

9 years ago

1.3.4

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

10 years ago

1.0.0

10 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.128

10 years ago

0.0.126

10 years ago

0.0.125

10 years ago

0.0.124

10 years ago

0.0.123

10 years ago

0.0.122

10 years ago

0.0.121

10 years ago

0.0.120

10 years ago

0.0.119

10 years ago

0.0.118

10 years ago

0.0.117

10 years ago

0.0.116

10 years ago

0.0.114

10 years ago

0.0.113

10 years ago

0.0.112

10 years ago

0.0.111

10 years ago

0.0.110

10 years ago

0.0.109

10 years ago

0.0.108

10 years ago

0.0.107

10 years ago

0.0.106

10 years ago

0.0.105

10 years ago

0.0.104

10 years ago

0.0.103

10 years ago

0.0.101

10 years ago

0.0.99

10 years ago

0.0.98

10 years ago

0.0.97

10 years ago

0.0.95

10 years ago

0.0.94

10 years ago

0.0.93

10 years ago

0.0.92

10 years ago

0.0.91

10 years ago

0.0.90

10 years ago

0.0.89

10 years ago

0.0.88

10 years ago

0.0.87

10 years ago

0.0.86

10 years ago

0.0.84

10 years ago

0.0.83

10 years ago

0.0.82

10 years ago

0.0.80

10 years ago

0.0.79

10 years ago

0.0.78

10 years ago

0.0.77

10 years ago

0.0.76

10 years ago

0.0.73

10 years ago

0.0.72

10 years ago

0.0.71

10 years ago

0.0.70

10 years ago

0.0.69

10 years ago

0.0.68

10 years ago

0.0.67

10 years ago

0.0.66

10 years ago

0.0.65

10 years ago

0.0.64

10 years ago

0.0.63

10 years ago

0.0.62

10 years ago

0.0.61

10 years ago

0.0.60

10 years ago

0.0.59

10 years ago

0.0.57

10 years ago

0.0.56

10 years ago

0.0.55

10 years ago

0.0.54

10 years ago

0.0.52

10 years ago

0.0.51

10 years ago

0.0.50

10 years ago

0.0.49

10 years ago

0.0.48

10 years ago

0.0.47

10 years ago

0.0.46

10 years ago

0.0.45

10 years ago

0.0.44

10 years ago

0.0.43

10 years ago

0.0.42

10 years ago