0.5.0 • Published 10 years ago
sexagesimal v0.5.0
sexagesimal
Convert between sexagesimal coordinates and decimal coordinates.
usage
with npm (and/or) browserify
npm install sexagesimalotherwise
curl https://raw.github.com/mapbox/sexagesimal/master/sexagesimal.jsexample
sexagesimal('66° 30′ 360″ N') // 66.6
sexagesimal('66° 30′ 720″ S') // -66.7
sexagesimal('66° 30′ 720" S') // -66.7
sexagesimal('66° 30′ 720" E') // 66.7
sexagesimal('66° 30′ 720" W') // -66.7
sexagesimal.pair('66N 32W') // [66, -32]api
sexagesimal(str, dims) // returns a number or nulldims is by default NSEW but can be other ordinal directions expressed
as a string of characters.
sexagesimal.pair(str, dims) // returns [lat, lon] or nulldims is by default NSEW but can be other ordinal directions expressed
as a string of characters.
sexagesimal.format(float, dimension) // returns a formatted stringFormat a single sexagesimal number. dimension must be a string, either
"lat" or "lon".
sexagesimal.formatPair({ lat: float, lon: float }) // returns a formatted stringFormat a sexagesimal coordinate.
