node-geopoint
v1.0.1
Published
JavaScript coordinate conversion library between Decimal Degree and Deg-Min-Sec.
Downloads
22
Readme
#node-geopoint
JavaScript coordinate conversion library between Decimal Degree and Deg-Min-Sec.
This library expects latitude and longitude in EPSG:4326 (WGS84). To convert between different projections check out Proj4js.
Installation
npm install node-geopoint
Convert Decimal -> Degrees
const geo = require('node-geopoint')
const lat = 58.74554729994484
const lng = 24.72504500749274
const res = geo(lat, lng)
console.log(res.lat.deg) // 58° 44' 43.97"
console.log(res.lng.deg) // 24° 43' 30.16"
Convert Degrees -> Decimal
const geo = require('node-geopoint')
const lat = '58° 44\' 43.97"'
const lng = '24° 43\' 30.16"'
const res = geo(lat, lng)
console.log(res.lat.dec) // 58.74554722222222
console.log(res.lng.dec) // 24.725044444444443