https://github.com/microjs/simplify
High-performance JavaScript polyline simplification
https://github.com/microjs/simplify
Last synced: 4 months ago
JSON representation
High-performance JavaScript polyline simplification
- Host: GitHub
- URL: https://github.com/microjs/simplify
- Owner: microjs
- Created: 2012-11-24T11:35:27.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2013-02-06T04:55:56.000Z (about 13 years ago)
- Last Synced: 2025-01-21T16:17:08.456Z (over 1 year ago)
- Language: JavaScript
- Size: 187 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
[](https://travis-ci.org/microjs/simplify)
# simplify
simplify is a high-performance JavaScript polyline simplification library
If you only need a 2D simplification library, check out [microjs/simplify-2D](https://github.com/microjs/simplify-2D).
If you only need a 3D simplification library, check out [microjs/simplify-3D](https://github.com/microjs/simplify-3D).
## Installation
$ component install microjs/simplify
## API
```javascript
var simplify = require('simplify');
simplify['2D'](points, tolerance, highQuality);
simplify['3D'](points, tolerance, highQuality);
```
Returns a simplified array of points
- `points` - An array of points in the format: `{x: Number, y: Number}` or `{x: Number, y: Number, z: 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