Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
geographiclib
Advanced tools
This library is a JavaScript implementation of the geodesic routines from GeographicLib. This solves the direct and inverse geodesic problems for an ellipsoid of revolution.
Licensed under the MIT/X11 License; see LICENSE.txt.
WARNING: Since version 2.x, this package has been separated into the geographiclib-geodesic and geographiclib-dms packages. geographiclib will be deprecated on 2023-05-01.
$ npm install geographiclib
In node, do
var GeographicLib = require("geographiclib");
Full documentation is provided at https://geographiclib.sourceforge.io/JavaScript/1.52.2/index.html.
var GeographicLib = require("geographiclib"),
geod = GeographicLib.Geodesic.WGS84, r;
// Find the distance from Wellington, NZ (41.32S, 174.81E) to
// Salamanca, Spain (40.96N, 5.50W)...
r = geod.Inverse(-41.32, 174.81, 40.96, -5.50);
console.log("The distance is " + r.s12.toFixed(3) + " m.");
// This prints "The distance is 19959679.267 m."
// Find the point 20000 km SW of Perth, Australia (32.06S, 115.74E)...
r = geod.Direct(-32.06, 115.74, 225, 20000e3);
console.log("The position is (" +
r.lat2.toFixed(8) + ", " + r.lon2.toFixed(8) + ").");
// This prints "The position is (32.11195529, -63.95925278)."
FAQs
JavaScript implementation of geodesic routines in GeographicLib
We found that geographiclib 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.