# sweepline-simplify

> A module for creating simple polygons out of self-intersecting polygons

Latest version **0.0.1** (published 2019-12-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2019-12-20 |
| First published | 2019-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 72.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rowanwins |

## Links

- npm: https://www.npmjs.com/package/sweepline-simplify
- npm.io page: https://npm.io/package/sweepline-simplify

## Dependencies (1)

- [tinyqueue](https://npm.io/package/tinyqueue.md) ^2.0.3

## Recent versions

- 0.0.1 (latest) — 2019-12-20

## README

# sweepline-simplify
A module for creating simple polygons out of self-intersecting polygons. Based on simplepolygon but made faster.

## Install
````
npm install sweepline-simplify
````

## Documentation
Valid inputs: Geojson `Polygon` or `MultiPolygon`.

````js
    const simplify = require('sweepline-simplify')

    const box = {type: 'Polygon', coordinates: [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]]}
    simplify(box)
    // true
````

## Benchmarks

````
// Basic example
// Sweepline simplify x 76,196 ops/sec ±2.28% (85 runs sampled)
// SimplePolygon x 29,164 ops/sec ±1.10% (85 runs sampled)
// - Fastest is Sweepline simplify

// Warsaw example
// Sweepline simplify x 20.27 ops/sec ±4.42% (38 runs sampled)
// simplepolygon - x Breaks
// - Fastest is Sweepline simplify
````

### Acknowledgements
This library leans heavily on the work in the [simplepolygon library](https://github.com/mclaeysb/simplepolygon/). The core difference is in swapping out the algorithm for finding the self-intersections.
Rbush has also been removed to reduce dependencies however this has made performance a bit slower so that needs investigation.

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