Socket
Book a DemoInstallSign in
Socket

@turnit/geo

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turnit/geo

Convert coordinates between `DMS` (degrees, minutes, seconds) and `DD` (decimal degrees).

latest
npmnpm
Version
0.2.0
Version published
Maintainers
0
Created
Source

@turnit/geo

Convert coordinates between DMS (degrees, minutes, seconds) and DD (decimal degrees).

Convert DMS to DD

import { convertDMStoLatLon } from '@turnit/geo';
import type { LatitudeDMSType, LongitudeDMSType } from '@turnit/geo';

const latitude: LatitudeDMSType = {
  degrees: 52,
  minutes: 23,
  seconds: 16.0188,
  northing: true,
};
const longitude: LongitudeDMSType = {
  degrees: 9,
  minutes: 44,
  seconds: 0.3818,
  easting: true,
};

const latlon = convertDMStoLatLon(latitude, longitude);
// {
//   lat: 52.387783,
//   lon: 9.7334394,
// };

Convert DD to DMS

import { convertLatLontoDMS } from '@turnit/geo';

const { latitude, longitude } = convertLatLontoDMS({
  lat: 52.387783,
  lon: 9.7334394,
});

// latitude = {
//   degrees: 52,
//   minutes: 23,
//   seconds: 16.0188,
//   northing: true,
// };
// longitude = {
//   degrees: 9,
//   minutes: 44,
//   seconds: 0.3818,
//   easting: true,
// };

Licensing

Licensed under the MIT License

A copy of the license is available in the repository's LICENSE file.

FAQs

Package last updated on 04 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts