1. geographic-coordinate-converter
Geographic latitude longitude coordinate format converter
geographic-coordinate-converter
Package: geographic-coordinate-converter
Created by: javidalpe
Last modified: Tue, 03 May 2022 13:48:07 GMT
Version: 1.0.0
License: MIT
Downloads: 21
Repository: https://github.com/javidalpe/coordinate-format-converter

Install

npm install geographic-coordinate-converter
yarn add geographic-coordinate-converter

Geographic Coordinate Format Converter

A library to transform geospatial coordinates.

Installation

To install the stable version:

npm install --save geographic-coordinate-converter

This assumes you are using npm as your package manager.

Usage

Instance the converter from one of the following methods:

 import { CoordinateConverter } from "./coordinate-converter"; 
		
CoordinateConverter.fromDecimal(array)
CoordinateConverter.fromDecimal(string)
CoordinateConverter.fromDegreeMinutes(string)
CoordinateConverter.fromDegreeMinutesSeconds(string)

Convert to the desired format:

 .toDecimalArray();
.toDecimal();
.toDegreeMinutes()
.toDegreeMinutesSeconds()	

Examples

 CoordinateConverter.fromDecimal([-36.01011, -2.34856])
	.toDegreeMinutes() //"36º 00.607' S 002º 20.914' W"
CoordinateConverter.fromDegreeMinutes("36º 00.607' S 002º 20.914' W")
	.toDegreeMinutesSeconds() //"36º 00' 36.4'' S 002º 20' 54.8'' W"
CoordinateConverter.fromDegreeMinutesSeconds("36º 00' 36.4'' S 002º 20' 54.8'' W")
	.toDecimal() //"-36.01011 -2.34856"
CoordinateConverter.fromDegreeMinutes("36º 00.607' S 002º 20.914' W")
	.toDecimalArray() //[-36.01012, -2.34857]		

License

MIT

Dependencies

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code