JSPM

simplify-geometry

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11706
  • Score
    100M100P100Q174463F
  • License MIT

Simplify geometry using the Ramer–Douglas–Peucker algorithm.

Package Exports

  • simplify-geometry

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simplify-geometry) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

simplify-geometry

Build Status

browser support

Simplify geometry using the Ramer–Douglas–Peucker 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.

Node

Example

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:

[ [ 0, 0 ], [ 2.5, 3 ], [ 5, 0 ] ]
[ [ 0, 0 ], [ 5, 0 ] ]

Browser

Browser builds are built with Browserify, and tested in various browsers with Testling:

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