Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

line-simplify-rdp

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

line-simplify-rdp

Simplify lines using the Ramer–Douglas–Peucker algorithm

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
149
increased by23.14%
Maintainers
1
Weekly downloads
 
Created
Source

line-simplify-rdp

Simplify polylines and polygons using the Ramer–Douglas–Peucker algorithm.

API

line-simplify-rdp

simplify(points, threshold, closed) ⇒ array

Return a simplified version of the polyline or polygon defined by the given points. Basically what happens is that some points are removed from the line, but only ones that leave the resulting line within a certain distance of the original.

Kind: Exported function
Returns: array - the simplified points. (This will always be separately allocated object, not the one passed in, but it will contain the same point objects passed in.)

ParamTypeDescription
pointsarraypolyline or polygon. Each element of the array must be an object with at least x and y numeric properties. Neither the array nor any member will be modified.
thresholdnumbermaximum distance the simplified line can be from the original. Should be grater than or equal to zero. Passing zero means only colinear points will be eliminated; greater values lead to more aggressive line approximations.
closedbooleanif the passed first point and the last points are the same, this flag does nothing. Otherwise, if closed is true, the points will be treated as a polygon with an implied last segment between the last point and the first point.

License

MIT

Keywords

FAQs

Package last updated on 06 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc