# @mapbox/geosimplify-js

> A WGS84 geography feature simplifier, based on simplify-js

Latest version **0.1.0** (published 2018-03-20) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @mapbox/geosimplify-js
pnpm add @mapbox/geosimplify-js
yarn add @mapbox/geosimplify-js
bun add @mapbox/geosimplify-js
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-03-20 |
| First published | 2018-03-20 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Author | Daniel Patterson |
| Maintainers | 1ec5, aaaandrea, aag6z, aarthykc, ajashton, akit, alianthes, aliceykuo, alinapaz, allierowan, alulsh, amishas157, ampetr89, amyleew, anandthakker, andygol, angela.navarro, ansis, aparlato, apavani, apendleton, arunasank, asheemmamoowala, atevans-mapbox, benjamintd, bhousel, bkowshik, boblannon, brendanmcfarland, brsbl, brunoabinader, bsrinivasa, bsudekum, camillacaros, camilo.sanin, cammace, captainbarbosa-mbx, caseymm, castledoor, charloyd, chaupow, chetangowda, chriscx, chrisloer, cknouss, cmtoomey, colleenmcginnis, d-prukop, danieljh, danmactough, danpat, danpaz-mb, danswick, dasulit, davidtheclark, deniskoronchik, dgearhart, dhcole, dianeschulze, dnesbitt, dnomadb, dputtick, drboyer, dthompson, edgar-marca, electrostat, elifitch, emilymcafee, emilymdubois, enf, ericdeveloper, eschow, fa7c0n, fabianguerra, flippmoke, franka, freenerd, friedbunny, geografa, ghoshkaj, gknisely, gretacb, guardiola31337, heyadam_mapbox, heystenson, hjudge, ian29, ianshward, ilyasaf, ingalls, isiyu, ivovandongen, jacquestardie, jayana, jc-clark, jcsg, jfirebaugh, jim-martin, jinnycho503, jjanczyszyn, jmkiley, jordanwebb, jothirnadh, jrpruit1, juliannebg, k-mahoney, kaibot3000, kalimar, karenell, karenzshea, katydecorah, kdiluca, kellyoung, kepta, kevinkreiser, kilatsat, kkaefer, l-r, langstonsmith, lbud, lily-chai, lingoded, lizziegooding, lobenichou, lshig, lucaswoj, luiswalter, lukasmartinelli, lukaspaczos, lxbarth, lyzidiamond, macro-shen, maikyon, mal-wood, maning, manoharuss, mapbox-admin, mapsam, markmisener, mateov, matt.gosline, mattficke, mcwhittemore, miccolis, mikelmaron, millzpaugh, mollymerp, morgane, morganherlocker, mourner, msirenko, mtirwin, nammala, natslaughter, nickcordella, nickidlugash, nickitaliano, nikhilprabhakar, nmargolis, norchard, normanb, oini, okoriep, oliikit, oormilavinod, otherwiseman, oxidase, paigemoody, pdgoodman, perrygeo, peterqliu, planemad, poornibadrinath, pratikyadav, pt-44, pveugen, rasagy, rclark, rcleedev, recursivefunk, rmrice, ryan-baumann, s-heisler, sabaelhilo, sabzo, sadiew, saikia.abhishek, samanbb, samely, samfader, sbma44, scottschultz, scottsfarley93, sgillies, springmeyer, srividyacb, tapasweni-pathak, taziam, tcql, themarex, tmpsantos, tony-cj, tridip1931, tristen, upendrayadav, vakila, vincents, virginiayung, vladimir.kananovich, willwhite, xianny, yhahn, yuffster, yuletide, zmully, zugaldia, zurihunter92 |
| Keywords | math, geometry, polyline, simplification |

## Links

- npm: https://www.npmjs.com/package/@mapbox/geosimplify-js
- Repository: https://github.com/mapbox/geosimplify-js
- Homepage: https://github.com/mapbox/geosimplify-js#readme
- Issues: https://github.com/mapbox/geosimplify-js/issues
- npm.io page: https://npm.io/package/@mapbox/geosimplify-js

## Dependencies (1)

- [cheap-ruler](https://npm.io/package/cheap-ruler.md) ^2.5.1

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2018-03-20

## README

## geosimplify-js

This module simplifies sequences of [longitude,latitude] pairs using
geography-aware measurement thresholds.

Based on https://github.com/mourner/simplify-js, `geosimplify-js`
fixes the problem that the simple pythagorean measure used in `simplify-js`
changes size if you simply give it longitude/latitude sequences to
simplify.

Usage:

```javascript
simplify([[lon,lat],[lon,lat],[lon,lat]], offsetThresholdInMetres, gapThresholdInMetres);
```

**path** - an array of `longitude,latitude` pairs

**offsetThreshold** - how far outside the straight line a point needs to be for it to be "kept"

**gapThreshold** - if removing a point would create a segment longer than this, do not remove it

Example:

```javascript
var geosimplify = require('geosimplify');
var coords = [ [ 15.603332, 78.227070 ],
               [ 15.606422, 78.226824 ],
               [ 15.608782, 78.226667 ],
               [ 15.610799, 78.226535 ] ];
var result = geosimplify(coords, 5, 50);
```

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