Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Calculate distances between GPS coordinates using the Haversine formula
Route Distance Calculator A Node.js package for calculating distances between GPS coordinates using the Haversine formula. This package can be used to estimate travel distances based on a series of waypoints or locations along a geo.
Installation To use the Route Distance Calculator package in your Node.js project, you can install it via npm:
bash Copy code npm install geo-route Usage Importing the Package javascript Copy code const RouteCalculator = require('geo-route'); Using the Functions
javascript Copy code const distance = RouteCalculator.haversine(lat1, lon1, lat2, lon2); 2. Find Location within Range The findLocation method takes a starting point, a geo (array of waypoints with latitude, longitude, and optional place name), and a range (in meters). It calculates the total distance traveled along the geo within the specified range and returns the nearest location within that range.
javascript Copy code const location = RouteCalculator.findLocation(startPoint, geo, range); Example javascript Copy code const RouteCalculator = require('geo-route');
const startPoint = [28.582769375987805, 77.32807517051698]; const geo = [ { lat: 28.583117962750734, lng: 77.32767820358278, place: "A" }, { lat: 28.582726980221604, lng: 77.3271417617798, place: "B" }, { lat: 28.58241607741395, lng: 77.32751190662385, place: "C" }, { lat: 28.58282119301215, lng: 77.32810735702515, place: "D" }, { lat: 28.582420788069395, lng: 77.3285096883774, place: "E" } ]; const range = 15; // 15 meters
const location = RouteCalculator.findLocation(startPoint, geo, range); console.log(location); License This project is licensed under the MIT License - see the LICENSE file for details.
Contributing Contributions are welcome! Please open an issue or submit a pull request to suggest changes or improvements.
Bugs/Issues If you encounter any bugs or issues, please report them on the GitHub Issues page.
Author Saurabh Singh
FAQs
Calculate distances between GPS coordinates using the Haversine formula
The npm package geo-route receives a total of 0 weekly downloads. As such, geo-route popularity was classified as not popular.
We found that geo-route demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.