1 | const getZone = require("./getZone");
|
2 | const getHemisphere = require("./getHemisphere");
|
3 |
|
4 | function getProjString(projection) {
|
5 | const zone = getZone(projection);
|
6 | const hemisphere = getHemisphere(projection);
|
7 | if (projection.toString().startsWith("269")) {
|
8 |
|
9 | return `+proj=utm +zone=${zone} +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs +type=crs`;
|
10 | } else {
|
11 | return `+proj=utm +zone=${zone}${hemisphere === "S" ? " +south " : " "}+ellps=WGS84 +datum=WGS84 +units=m +no_defs`;
|
12 | }
|
13 | }
|
14 |
|
15 | if (typeof define === "function" && define.amd) {
|
16 | define(function () {
|
17 | return getProjString;
|
18 | });
|
19 | }
|
20 |
|
21 | if (typeof module === "object") {
|
22 | module.exports = getProjString;
|
23 | module.exports.default = getProjString;
|
24 | }
|