Standard Toolkit
Packages@accelint/geo

Overview

A collection of JavaScript functions for working with coordinates and geospatial data.

Installation

pnpm add @accelint/geo

Usage

// Import coordinate utilities
import { createCoordinate, coordinateSystems } from '@accelint/geo';

// Import formatters and parsers
import { formatDecimalDegrees, parseDecimalDegrees } from '@accelint/geo';
import { parseMGRS, parseUTM } from '@accelint/geo';

// Import geodesy functions
import { bearing, distance, greatCirclePoints, midpoint } from '@accelint/geo/geodesy';

Available Exports

Export PathDescription
coordinates/coordinateParse, validate, convert, and format geographic coordinates across multiple notation systems
coordinates/latlon/decimal-degreesFormat and parse latitude/longitude in decimal degrees notation
coordinates/latlon/degrees-decimal-minutesFormat and parse coordinates in degrees decimal minutes notation
coordinates/latlon/degrees-minutes-secondsFormat and parse coordinates in degrees minutes seconds notation
coordinates/mgrs/parserParse Military Grid Reference System (MGRS) coordinate strings
coordinates/utm/parserParse Universal Transverse Mercator (UTM) coordinate strings
geodesyGreat-circle bearing, distance, midpoint, and path sampling between two [longitude, latitude] points

Geodesy

Compute great-circle relationships between two [longitude, latitude] points on a spherical Earth. All geodesy functions take LonLatTuple values (GeoJSON order), which is the reverse of the [latitude, longitude] order used by createCoordinate.

  • bearing - Initial bearing in degrees clockwise from true north, [0, 360)
  • distance - Distance in meters
  • midpoint - Midpoint along the shortest great-circle path
  • greatCirclePoints - Evenly spaced vertices along the path, with unwrapped longitudes for drawing
  • toSphericalPoints - Shared validation step that returns LatLonSpherical points

On this page