JSPM

@pusky/transform-coordinates

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q16065F
  • License ISC

Transform coordinates from one coordinate system to another.

Package Exports

  • @pusky/transform-coordinates

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@pusky/transform-coordinates) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

transform-coordinates

Transform coordinates from one coordinate system to another. Just a wrapper around proj4 and epsg-index.

npm version build status ISC-licensed minimum Node.js version chat with me on Gitter support me via GitHub Sponsors

Installing

npm install transform-coordinates

Rationale

proj4 is a battle-proven tool for converting from one any coordinate system into any other. You need to specify a long and complicated string for both system though, to tell proj4 how to convert.

epsg.io has an index of those strings. epsg-index is an offline copy of them.

This module glues together proj4 and epsg-index and returns a clean API.

Usage

const transformation = require('transform-coordinates')

const transform = transformation('EPSG:4326', '3068') // WGS 84 to Soldner Berlin

console.error(transform.forward({x: 13.4105, y: 52.5034}))
// {
// 	x: 25405.407133664165,
// 	y: 19607.826100560924,
// 	z: -40.94089552294463
// }

transformation(from, to) returns a proj4 object with forward() and inverse().

See also

  • projections – Collection of (stereographic) map/coordinate projections.
  • proj4 – library to transform coordinates from one coordinate system to another
  • epsg-index – A machine-readable index of all EPSG coordinate systems.

Contributing

If you have a question or have difficulties using transform-coordinates, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.