# turf-simplify

> simplify geographic shapes

Latest version **3.0.12** (published 2016-07-05) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install turf-simplify
pnpm add turf-simplify
yarn add turf-simplify
bun add turf-simplify
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.12 |
| Published | 2016-07-05 |
| First published | 2014-05-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Morgan Herlocker |
| Maintainers | cspanring, cwmma, jseppi, jvrousseau, lyzidiamond, morganherlocker, mourner, tcql, tmcw |
| Keywords | turf, gis, simplify |

## Links

- npm: https://www.npmjs.com/package/turf-simplify
- Repository: https://github.com/Turfjs/turf-simplify
- Issues: https://github.com/Turfjs/turf-simplify/issues
- npm.io page: https://npm.io/package/turf-simplify

## Dependencies (1)

- [simplify-js](https://npm.io/package/simplify-js.md) ^1.2.1

## Recent versions

- 3.0.12 (latest) — 2016-07-05
- 3.0.7-canary.ae89c8b3 (canary) — 2016-06-14
- 3.0.10 — 2016-06-15
- 3.0.1 — 2016-05-16
- 3.0.0-canary.7879bf6c — 2016-05-16
- 3.0.0-canary.2f5f7167 — 2016-05-16
- 1.0.3 — 2015-02-06
- 1.0.2 — 2015-01-06
- 1.0.1 — 2015-01-06
- 1.0.0 — 2014-12-12
- 0.0.0 — 2014-05-29

## README

# turf-simplify

# simplify

Takes a [LineString](LineString) or [Polygon](Polygon) and returns a simplified version. Internally uses [simplify-js](http://mourner.github.io/simplify-js/) to perform simplification.

**Parameters**

-   `feature` **(Feature&lt;(LineString | Polygon | MultiLineString | MultiPolygon)> | FeatureCollection | GeometryCollection)** feature to be simplified
-   `tolerance` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** simplification tolerance
-   `highQuality` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether or not to spend more time to create
    a higher-quality simplification with a different algorithm

**Examples**

```javascript
var feature = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-70.603637, -33.399918],
      [-70.614624, -33.395332],
      [-70.639343, -33.392466],
      [-70.659942, -33.394759],
      [-70.683975, -33.404504],
      [-70.697021, -33.419406],
      [-70.701141, -33.434306],
      [-70.700454, -33.446339],
      [-70.694274, -33.458369],
      [-70.682601, -33.465816],
      [-70.668869, -33.472117],
      [-70.646209, -33.473835],
      [-70.624923, -33.472117],
      [-70.609817, -33.468107],
      [-70.595397, -33.458369],
      [-70.587158, -33.442901],
      [-70.587158, -33.426283],
      [-70.590591, -33.414248],
      [-70.594711, -33.406224],
      [-70.603637, -33.399918]
    ]]
  }
};

var tolerance = 0.01;

var simplified = turf.simplify(
 feature, tolerance, false);

//=feature

//=simplified
```

Returns **(Feature&lt;(LineString | Polygon | MultiLineString | MultiPolygon)> | FeatureCollection | GeometryCollection)** a simplified feature

---

This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.

### Installation

Install this module individually:

```sh
$ npm install turf-simplify
```

Or install the Turf module that includes it as a function:

```sh
$ npm install turf
```

---
_Source: https://npm.io/package/turf-simplify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
