JavaScript implementation of DMS routines in GeographicLib
npm install geographiclib-dmsThis package is a JavaScript implementation of the DMS (degree,
minute, second) handling routines from
GeographicLib.
Prior to version 2.0.0, this was a component of the node package
geographiclib. As of
version 2.0.0, that package was split into the packages
geographiclib-geodesic
and
geographiclib-dms
(this package).
geographiclib will be
deprecated on 2023-05-01.
Licensed under the MIT/X11 License; see
LICENSE.txt.
``bash`
$ npm install geographiclib-dms
In node, do
`javascript`
var DMS = require("geographiclib-dms");
Full documentation is provided at
https://geographiclib.sourceforge.io/JavaScript/doc.
`javascript``
var DMS = require("geographiclib-dms"),
ang = DMS.Decode("127:54:3.123123W");
console.log("Azimuth " +
DMS.Encode(ang.val, DMS.MINUTE, 7, ang.ind) +
" = " + ang.val.toFixed(9));
// This prints "Azimuth 127°54.0520521'W = -127.900867534"
* algorithms + js code: Charles Karney (karney@alum.mit.edu)
* node.js port: Yurij Mikhalevich (yurij@mikhalevi.ch)