![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
gps-distance
Advanced tools
A node module for performing distance calculations between GPS coordinates
npm install gps-distance
gps-distance
supports two syntaxes for convenience. You can measure just between two points and supply in your GPS coordinates as direct arguments to distance in the form (source_lat, source_lon, destination_lat, destination_lon)
, or you can use an array of points each in [lat,lon]
format. See the examples below.
var distance = require('gps-distance');
// Measure between two points:
var result = distance(45.527517, -122.718766, 45.373373, -121.693604);
// result is 81.78450202539503
// Measure a list of GPS points along a path:
var path = [
[45.527517, -122.718766],
[45.373373, -121.693604],
[45.527517, -122.718766]
];
var result2 = distance(path);
// result2 is 163.56900405079006
To compute the distance travelled in a tracked GPX file, use gps-distance
with the gpx-stream
module ( http://npmjs.org/package/gpx-stream/ ).
var GPXstream = require('gpx-stream');
var distance = require('gps-distance');
var points = new GPXstream();
var source = fs.createReadStream('./marathon.gpx');
var path = [];
source.pipe(points);
points.on('readable', function() {
var point;
while(point = points.read()) {
path.push([point.lat, point.lon]);
}
});
points.on('end', function() {
console.log('Distance travelled: ' + distance(path) + ' km');
});
Distances are returned in kilometers and computed using the Haversine formula.
FAQs
Node module for computing distances between GPS coordinates
The npm package gps-distance receives a total of 0 weekly downloads. As such, gps-distance popularity was classified as not popular.
We found that gps-distance demonstrated a not healthy version release cadence and project activity because the last version was released 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.