# turf
**Repository Path**: mirrors_davidtheclark/turf
## Basic Information
- **Project Name**: turf
- **Description**: A modular geospatial engine written in JavaScript
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-08
- **Last Updated**: 2026-04-11
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README

======
[![Version Badge][npm-img]][npm-url]
[](https://circleci.com/gh/Turfjs/turf)
[![Gitter chat][gitter-img]][gitter-url]
[npm-img]: https://img.shields.io/npm/v/@turf/turf.svg
[npm-url]: https://www.npmjs.com/package/@turf/turf
[gitter-img]: https://badges.gitter.im/Turfjs/turf.png
[gitter-url]: https://gitter.im/Turfjs/turf
***A modular geospatial engine written in JavaScript***
[turfjs.org](http://turfjs.org/)
- - -
[Turf](https://turfjs.org) is a [JavaScript library](https://en.wikipedia.org/wiki/JavaScript_library) for [spatial analysis](http://en.wikipedia.org/wiki/Spatial_analysis). It includes traditional spatial operations, helper functions for creating [GeoJSON](http://geojson.org) 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](https://www.npmjs.com/package/turf) with [Node.js](http://nodejs.org/) (see below).
## Installation
**In Node.js:**
```bash
npm install @turf/turf
```
**In browser:**
Download the [minified file](https://api.tiles.mapbox.com/mapbox.js/plugins/turf/v3.0.11/turf.min.js), and include it in a script tag. This will expose a global variable named `turf`.
```html
```
You can create light-weight turf builds with only the functions you need using the [turfjs-builder UI](https://turfjs-builder.herokuapp.com/) 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](http://browserify.org/) 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:
```sh
npm install @turf/point @turf/buffer
```
**Bower:**
_Not recommend. Please don't use Bower. Use Browserify, Webpack, or the CDN instead._
The latest Bower build is at:
```
https://npmcdn.com/@turf/turf@3.1.1/bower.zip
```
- - -
### 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.
Most Turf functions work with GeoJSON features. These are 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:
```js
var point1 = turf.point([0, 0]);
var point2 = {
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [0, 0]
},
properties: {}
};
```