Show HN: CoordConversions NPM Module for Map Coordinate Conversions
25 days ago
- #geographic-coordinates
- #conversion-library
- #TypeScript
- A TypeScript library for converting between geographic coordinate formats: Decimal Degrees (DD), Degrees-Minutes (DM), and Degrees-Minutes-Seconds (DMS).
- Features include bidirectional conversions, smart parsing, robust validation, type safety, precision control, and rich formatting options.
- Supports both individual coordinates and coordinate pairs with comprehensive parsing, conversion, and formatting functions.
- Includes functions for parsing to DD, converting between formats (DD ↔ DM ↔ DMS), and formatting for display.
- Offers pair functions for working with latitude and longitude together, ensuring consistent conversions and formatting.
- Provides detailed validation for ranges (latitude: -90° to +90°, longitude: -180° to +180°) and format checks.
- Supports various input formats, including hemisphere indicators, and handles automatic hemisphere detection.
- Can be used in different environments: Node.js, ES modules, and browser with global script or CDN links.
- Includes a demo and examples for quick integration and usage.
- MIT licensed, lightweight, with zero dependencies and comprehensive test coverage.