Socket
Socket
Sign inDemoInstall

mh-simplify-coordinates

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mh-simplify-coordinates

simplify coordinates by killometers


Version published
Weekly downloads
47
increased by291.67%
Maintainers
1
Install size
6.62 kB
Created
Weekly downloads
 

Readme

Source

MH Simplify Coordinates

Algorithm based on Ramer–Douglas–Peucker Algorithm it simplify coordinates by kilometers

The starting curve is an ordered set of points or lines and the distance dimension ε > 0.

The algorithm Recursion divides the line. Initially it is given all the points between the first and last point. It automatically marks the first and last point to be kept. It then finds the point that is furthest from the line segment with the first and last points as end points; this point is obviously furthest on the curve from the approximating line segment between the end points. If the point is closer than ε to the line segment, then any points not currently marked to be kept can be discarded without the simplified curve being worse than ε.

If the point furthest from the line segment is greater than ε from the approximation then that point must be kept. The algorithm recursively calls itself with the first point and the furthest point and then with the furthest point and the last point, which includes the furthest point being marked as kept.

When the recursion is completed a new output curve can be generated consisting of all and only those points that have been marked as kept.

enter image description here

Implementation

npm install mh-simplify-coordinates

MHSimplify(coord,k)

Result

simplify coordinates

Demo

https://mh-location.firebaseapp.com/

Keywords

FAQs

Last updated on 27 Aug 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc