utm-utils

0.6.1 • Public • Published

utm-utils

Super Light-Weight Utility Functions for Working with Universal Transverse Mercator

Usage

Check if EPSG Code Refers to UTM

const isUTM = require('utm-utils/src/isUTM');

isUTM(32619); // true
isUTM("32619"); // true
isUTM("EPSG:32619"); // true
isUTM("+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"); // true

isUTM("3857"); // false

Get Hemisphere from EPSG Code

const getHemisphere = require('utm-utils/src/getHemisphere');

getHemisphere('32617'); // "N"

Get Zone from EPSG Code

const getZone = require('utm-utils/src/getZone');

getZone('32617'); // 17

Get PROJ String from EPSG Code

const getProjString = require('utm-utils/src/getProjString');

getProjString('32617');
"+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"

Get EPSG Code from a PROJ.4 String

const getCodeFromProjString = require('utm-utils/src/getCodeFromProjString');

getCodeFromProjString("+proj=utm +zone=17 +ellps=WGS84 +datum=WGS84 +units=m +no_defs");
32617

getCodeFromProjString("+proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs")
26916

Get EPSG Code from ESRI Well-Known Text

const getCodeFromEsriWKT = require('utm-utils/src/getCodeFromEsriWKT.js');

getCodeFromEsriWKT(`PROJCS["WGS_1984_UTM_Zone_17N",GEOGCS["GCS_WGS_1984",...,UNIT["Meter",1.0]]`);
32617

Support

Email the package author at daniel.j.dufour@gmail.com or post an issue at https://github.com/danieljdufour/utm-utils/issues

Package Sidebar

Install

npm i utm-utils

Weekly Downloads

2,133

Version

0.6.1

License

CC0-1.0

Unpacked Size

14.2 kB

Total Files

10

Last publish

Collaborators

  • danieljdufour