# simplify-geometry

> Simplify geometry using the Ramer–Douglas–Peucker algorithm.

Latest version **0.0.2** (published 2015-02-02) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-02-02 |
| First published | 2013-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 80 |
| Author | Sean Brewer |
| Maintainers | seabre |
| Keywords | geometry, Douglas–Peucker, simplify |

## Links

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

## Recent versions

- 0.0.2 (latest) — 2015-02-02
- 0.0.1 — 2013-07-14

## README

# simplify-geometry
[![Build Status](https://travis-ci.org/seabre/simplify-geometry.png)](https://travis-ci.org/seabre/simplify-geometry)

[![browser support](https://ci.testling.com/seabre/simplify-geometry.png)](https://ci.testling.com/seabre/simplify-geometry)

Simplify geometry using the [Ramer–Douglas–Peucker algorithm](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm).

If you need to simplify geometries, for instance reducing the number of points in a polygon, this will help you. You could use this in [Leaflet](https://github.com/Leaflet/Leaflet).

## Node

### Example

```javascript
var simplify = require('simplify-geometry');
var linestring = [[0,0], [2.5,3], [5,0]];

console.log(simplify(linestring, 2.9));
console.log(simplify(linestring, 3));
```

Output:
```javascript
[ [ 0, 0 ], [ 2.5, 3 ], [ 5, 0 ] ]
[ [ 0, 0 ], [ 5, 0 ] ]
```

## Browser

Browser builds are built with [Browserify](https://github.com/substack/node-browserify), and tested in various browsers with [Testling](https://ci.testling.com/):

* https://github.com/seabre/simplify-geometry/blob/master/simplifygeometry-0.0.2.js
* https://github.com/seabre/simplify-geometry/blob/master/simplifygeometry-0.0.2.min.js

You can see an example here, which uses Leaflet: http://seabre.github.io/simplify-geometry/

With example code here: https://github.com/seabre/simplify-geometry/tree/master/examples/browser


## License
[MIT License](http://en.wikipedia.org/wiki/MIT_License)

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