https://github.com/microjs/simplify-2d
simplify-2D is a high-performance JavaScript 2D polyline simplification library
https://github.com/microjs/simplify-2d
Last synced: 10 months ago
JSON representation
simplify-2D is a high-performance JavaScript 2D polyline simplification library
- Host: GitHub
- URL: https://github.com/microjs/simplify-2d
- Owner: microjs
- Created: 2012-11-23T19:07:41.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-11-24T12:02:08.000Z (over 13 years ago)
- Last Synced: 2025-05-24T15:33:13.297Z (11 months ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
[](https://travis-ci.org/microjs/simplify-2D)
# simplify-2D
simplify-2D is a high-performance JavaScript 2D polyline simplification library
If you need a 3D simplification library, check out [microjs/simplify-3D](https://github.com/microjs/simplify-3D).
## Installation
$ component install microjs/simplify-2D
$ npm install simplify-2d
## API
```javascript
var simplify = require('simplify-2D');
simplify(points, tolerance, highQuality)
```
Returns a simplified array of points
- `points` - An array of points in the format: `{x: Number, y: Number}`
- `tolerance` - Optional number (defaulting to 1) Affects the amount of simplification (in the same metric as the point coordinates).
- `highQuality` - Optional boolean (defaults to false) - Excludes distance-based preprocessing step which leads to higher quality but runs ~10-20 times slower.
## License
MIT