2.0.0 • Published 2 years ago

geographiclib-dms v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

JavaScript implementation of the DMS routines in GeographicLib

This 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.

Installation

$ npm install geographiclib-dms

Usage

In node, do

var DMS = require("geographiclib-dms");

Documentation

Full documentation is provided at https://geographiclib.sourceforge.io/JavaScript/doc.

Examples

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"

Authors

  • algorithms + js code: Charles Karney (charles@karney.com)
  • node.js port: Yurij Mikhalevich (yurij@mikhalevi.ch)