https://github.com/danieljdufour/utm-utils
Utility Functions for Working with Universal Transverse Mercator
https://github.com/danieljdufour/utm-utils
gis mercator projection utm
Last synced: about 1 year ago
JSON representation
Utility Functions for Working with Universal Transverse Mercator
- Host: GitHub
- URL: https://github.com/danieljdufour/utm-utils
- Owner: DanielJDufour
- License: cc0-1.0
- Created: 2020-03-19T11:29:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-04T18:34:13.000Z (almost 3 years ago)
- Last Synced: 2025-03-22T18:51:34.078Z (about 1 year ago)
- Topics: gis, mercator, projection, utm
- Language: JavaScript
- Size: 40 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# utm-utils
Super Light-Weight Utility Functions for Working with [Universal Transverse Mercator](https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system)
# Usage
## Check if EPSG Code Refers to UTM
```js
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
```js
const getHemisphere = require('utm-utils/src/getHemisphere');
getHemisphere('32617'); // "N"
```
## Get Zone from EPSG Code
```js
const getZone = require('utm-utils/src/getZone');
getZone('32617'); // 17
```
## Get PROJ String from EPSG Code
```js
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
```js
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
```js
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