Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
location-utilities
Advanced tools
Readme
Coordinate formatting, location calculation utilities, and NMEA sentence parser.
This module provides many useful functions:
npm install location-utilities --save
var LocationUtility = require('path-to-module-index-file/index.js');
import { LocationUtility } from 'location-utilities';
// Pass 'imp' for imperial and 'm' for metric
// Returns an object with the parsed data
// Unit is either m for metric or imp for imperial
// Measurements are returned in meters or feet
// Longitude and latitude are returned in decimal degrees
LocationUtility.parseNMEA(NMEASentence, unit);
// Returns an object with the parsed data and casts it to a NMEA sentence interface
LocationUtility.parseNMEA(NMEASentence, 'imp') as LocationUtility.GGA;
// Supports all standard NMEA sentences as parse functions
// Replace GGA with the name of the sentence you are trying to parse
// Measurements are returned in meters or feet
// Longitude and latitude are returned in decimal degrees
LocationUtility.parseGGA(NMEASentence, 'imp');
// Returns horizontal accuracy as a number
// Unit is either m for metric or imp for imperial
// Measurements are returned in meters or feet
let parsedGST = LocationUtility.parseGST(NMEAGSTSentence, 'imp');
LocationUtility.horizontalAccuracy(parsedGST.stdLatitudeError, parsedGST.stdLongitudeError, 'imp');
// Returns an object containing decimal degrees for both latitude and longitude
// Latitude direction is either N for North or S for South
// Longitude direction is either E for East or W for west
LocationUtility.DMToDD(latitudeDirection, latitude, longitudeDirection, longitude);
// Returns decimal degrees for latitude as a number
// Latitude direction is either N for North or S for South
LocationUtility.DMLatToDD(latitudeDirection, latitude);
// Returns decimal degrees for longitude as a number
// Longitude direction is either E for East or W for west
LocationUtility.DMLongToDD(longitudeDirection, longitude);
// Returns degrees minutes seconds for latitude as a string
LocationUtility.DDLatToDMS(latitude);
// Returns degrees minutes seconds for longitude as a string
LocationUtility.DDLongToDMS(longitude);
// Returns decimal degrees as a number
// Looks for strings in this format: 138° 31' 50" E
LocationUtility.DMSToDD(longitude);
// Returns the distance in the desired unit
// Unit is either m for metric or imp for imperial
// Longitude points and latitude points must be in decimal degrees
// Measurements are returned in kilometers or miles
LocationUtility.calculateDistance(point1Latitude, point1Longitude, point2Latitude, point2Longitude, unit);
FAQs
Coordinate formatting, location calculation utilities, and NMEA sentence parser.
The npm package location-utilities receives a total of 16 weekly downloads. As such, location-utilities popularity was classified as not popular.
We found that location-utilities demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.