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@everything-registry/sub-chunk-2986wenchmyviewwhzbcx_bimwhzbcx_web_appwhzbcx_web_app1whzbcx_web_plugxmgissupermaptemplatesbss_cgfxreact-webmapstacker-of-worldsseattle-boundariesseattle-boundaries-datathreebox-dwthreeboxlythreeboxnpmreact-maptalks-toolsoveny2micro-ly-componentslmaplatlon2countryisodistintroturfm2pmixologyhoodsidlyhelimapgisckds_cxgissbss_pluggis_gaud_testgjvmaptalks-toolsmap-sdk-leafletmapbox-draw-expandmapboxgl-measure-toolmaha-geographical-accessibility-components-tempparcel-gridderpacktesopenseadragon-annotations-cellmarkerosmlint-helperosm-mini-editorosm2geojson-polygonosm2x3dopenride-serveropenlayermaplxpolygon-city-clipolygon-city-cli-multinode-geojson-gridreact-leaflet-markers-in-polygonreact-leaflet-box-select-measurementreact-leaflet-box-select-measurement-privatensc-olnsc-threespannsc-earthnode-red-contrib-turfjsnew-micro-componentsqm_maplibreqm-vmapqlqz-framerhom-feature-servicerhom-route-matchrhom-route-matchersoonmapsnap-app-modelsts-aerodata-franceturf-bathwaterturf-cliturf-runnerturf-jsdoctilemantletile-makertorpedo@barbora-delivery/vroom-route-planner@barbora-express/courier-app-ui@citydna/app-aboriginal-melbourne-map@citydna/app-melbourne-historical-map@citydna/app-townhall-mapzbcx_gistjxmc_yxxw-soonmapvue-softpro-uiwebsbsswebsbss_plug@formbird/nodes@geotiff/gio@lambda-platform/dataform@lambda-platform/lambda-builder@lambda-platform/lambda-vue@lambda-platform/public-vue-builder@moon-design/pro-maptalks-tools@opengis/simple-map@npmmatrix/matrixscript@supermap/react-iclient-mapboxgl@supermapgis/react-iclient-mapboxgl@sipsdwangs/sonemap@cver-design/pro-maptalks-tools
7.0.0-alpha.1

6 years ago

3.0.14

9 years ago

3.0.13

9 years ago

3.0.12

9 years ago

3.0.11

9 years ago

3.0.10

9 years ago

3.0.9

9 years ago

3.0.7

9 years ago

3.0.6

9 years ago

3.0.5

9 years ago

3.0.4

9 years ago

3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.4.0

10 years ago

1.3.5

10 years ago

1.3.4

10 years ago

1.3.3

10 years ago

1.3.2

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.1

10 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

11 years ago

0.2.0

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.128

11 years ago

0.0.126

11 years ago

0.0.125

11 years ago

0.0.124

11 years ago

0.0.123

11 years ago

0.0.122

11 years ago

0.0.121

11 years ago

0.0.120

11 years ago

0.0.119

11 years ago

0.0.118

11 years ago

0.0.117

11 years ago

0.0.116

11 years ago

0.0.114

11 years ago

0.0.113

11 years ago

0.0.112

11 years ago

0.0.111

11 years ago

0.0.110

11 years ago

0.0.109

11 years ago

0.0.108

11 years ago

0.0.107

11 years ago

0.0.106

11 years ago

0.0.105

11 years ago

0.0.104

11 years ago

0.0.103

11 years ago

0.0.101

11 years ago

0.0.99

11 years ago

0.0.98

11 years ago

0.0.97

11 years ago

0.0.95

11 years ago

0.0.94

11 years ago

0.0.93

11 years ago

0.0.92

11 years ago

0.0.91

11 years ago

0.0.90

11 years ago

0.0.89

11 years ago

0.0.88

11 years ago

0.0.87

11 years ago

0.0.86

11 years ago

0.0.84

11 years ago

0.0.83

11 years ago

0.0.82

11 years ago

0.0.80

11 years ago

0.0.79

11 years ago

0.0.78

11 years ago

0.0.77

11 years ago

0.0.76

11 years ago

0.0.73

11 years ago

0.0.72

11 years ago

0.0.71

11 years ago

0.0.70

11 years ago

0.0.69

11 years ago

0.0.68

11 years ago

0.0.67

11 years ago

0.0.66

11 years ago

0.0.65

11 years ago

0.0.64

11 years ago

0.0.63

11 years ago

0.0.62

11 years ago

0.0.61

11 years ago

0.0.60

11 years ago

0.0.59

11 years ago

0.0.57

11 years ago

0.0.56

11 years ago

0.0.55

11 years ago

0.0.54

11 years ago

0.0.52

11 years ago

0.0.51

11 years ago

0.0.50

11 years ago

0.0.49

11 years ago

0.0.48

11 years ago

0.0.47

11 years ago

0.0.46

11 years ago

0.0.45

11 years ago

0.0.44

11 years ago

0.0.43

11 years ago

0.0.42

11 years ago