@accelint/geo 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/catalog-info.yaml +1 -1
- package/dist/cartesian.d.ts +3 -1
- package/dist/cartesian.js +34 -5
- package/dist/cartesian.js.map +1 -1
- package/dist/coordinates/coordinate.d.ts +37 -25
- package/dist/coordinates/coordinate.js +71 -77
- package/dist/coordinates/coordinate.js.map +1 -1
- package/dist/coordinates/latlon/decimal-degrees/formatter.d.ts +16 -2
- package/dist/coordinates/latlon/decimal-degrees/formatter.js +17 -3
- package/dist/coordinates/latlon/decimal-degrees/formatter.js.map +1 -1
- package/dist/coordinates/latlon/decimal-degrees/parser.d.ts +17 -4
- package/dist/coordinates/latlon/decimal-degrees/parser.js +60 -62
- package/dist/coordinates/latlon/decimal-degrees/parser.js.map +1 -1
- package/dist/coordinates/latlon/decimal-degrees/system.d.ts +16 -5
- package/dist/coordinates/latlon/decimal-degrees/system.js +26 -14
- package/dist/coordinates/latlon/decimal-degrees/system.js.map +1 -1
- package/dist/coordinates/latlon/degrees-decimal-minutes/formatter.d.ts +16 -2
- package/dist/coordinates/latlon/degrees-decimal-minutes/formatter.js +19 -8
- package/dist/coordinates/latlon/degrees-decimal-minutes/formatter.js.map +1 -1
- package/dist/coordinates/latlon/degrees-decimal-minutes/parser.d.ts +17 -4
- package/dist/coordinates/latlon/degrees-decimal-minutes/parser.js +79 -71
- package/dist/coordinates/latlon/degrees-decimal-minutes/parser.js.map +1 -1
- package/dist/coordinates/latlon/degrees-decimal-minutes/system.d.ts +16 -5
- package/dist/coordinates/latlon/degrees-decimal-minutes/system.js +30 -19
- package/dist/coordinates/latlon/degrees-decimal-minutes/system.js.map +1 -1
- package/dist/coordinates/latlon/degrees-minutes-seconds/formatter.d.ts +16 -2
- package/dist/coordinates/latlon/degrees-minutes-seconds/formatter.js +21 -10
- package/dist/coordinates/latlon/degrees-minutes-seconds/formatter.js.map +1 -1
- package/dist/coordinates/latlon/degrees-minutes-seconds/parser.d.ts +17 -4
- package/dist/coordinates/latlon/degrees-minutes-seconds/parser.js +81 -70
- package/dist/coordinates/latlon/degrees-minutes-seconds/parser.js.map +1 -1
- package/dist/coordinates/latlon/degrees-minutes-seconds/system.d.ts +16 -5
- package/dist/coordinates/latlon/degrees-minutes-seconds/system.js +32 -21
- package/dist/coordinates/latlon/degrees-minutes-seconds/system.js.map +1 -1
- package/dist/coordinates/latlon/internal/coordinate-system.d.ts +22 -9
- package/dist/coordinates/latlon/internal/coordinate-system.js +11 -2
- package/dist/coordinates/latlon/internal/create-cache.d.ts +17 -3
- package/dist/coordinates/latlon/internal/create-cache.js +27 -7
- package/dist/coordinates/latlon/internal/create-cache.js.map +1 -1
- package/dist/coordinates/latlon/internal/exhaustive-errors.d.ts +4 -2
- package/dist/coordinates/latlon/internal/exhaustive-errors.js +107 -62
- package/dist/coordinates/latlon/internal/exhaustive-errors.js.map +1 -1
- package/dist/coordinates/latlon/internal/format.d.ts +8 -6
- package/dist/coordinates/latlon/internal/format.js +24 -11
- package/dist/coordinates/latlon/internal/format.js.map +1 -1
- package/dist/coordinates/latlon/internal/in-range.d.ts +3 -1
- package/dist/coordinates/latlon/internal/in-range.js +22 -8
- package/dist/coordinates/latlon/internal/in-range.js.map +1 -1
- package/dist/coordinates/latlon/internal/index.d.ts +35 -33
- package/dist/coordinates/latlon/internal/index.js +64 -102
- package/dist/coordinates/latlon/internal/index.js.map +1 -1
- package/dist/coordinates/latlon/internal/lexer.d.ts +4 -2
- package/dist/coordinates/latlon/internal/lexer.js +54 -33
- package/dist/coordinates/latlon/internal/lexer.js.map +1 -1
- package/dist/coordinates/latlon/internal/ordinal.d.ts +3 -1
- package/dist/coordinates/latlon/internal/ordinal.js +17 -5
- package/dist/coordinates/latlon/internal/ordinal.js.map +1 -1
- package/dist/coordinates/latlon/internal/parse-format.d.ts +23 -10
- package/dist/coordinates/latlon/internal/parse-format.js +37 -54
- package/dist/coordinates/latlon/internal/parse-format.js.map +1 -1
- package/dist/coordinates/latlon/internal/parse.d.ts +18 -4
- package/dist/coordinates/latlon/internal/parse.js +55 -9
- package/dist/coordinates/latlon/internal/parse.js.map +1 -1
- package/dist/coordinates/latlon/internal/pipes/check-ambiguous.d.ts +17 -3
- package/dist/coordinates/latlon/internal/pipes/check-ambiguous.js +31 -16
- package/dist/coordinates/latlon/internal/pipes/check-ambiguous.js.map +1 -1
- package/dist/coordinates/latlon/internal/pipes/check-numbers.d.ts +16 -2
- package/dist/coordinates/latlon/internal/pipes/check-numbers.js +30 -28
- package/dist/coordinates/latlon/internal/pipes/check-numbers.js.map +1 -1
- package/dist/coordinates/latlon/internal/pipes/fix-bearings.d.ts +18 -4
- package/dist/coordinates/latlon/internal/pipes/fix-bearings.js +66 -54
- package/dist/coordinates/latlon/internal/pipes/fix-bearings.js.map +1 -1
- package/dist/coordinates/latlon/internal/pipes/fix-dividers.d.ts +18 -4
- package/dist/coordinates/latlon/internal/pipes/fix-dividers.js +42 -25
- package/dist/coordinates/latlon/internal/pipes/fix-dividers.js.map +1 -1
- package/dist/coordinates/latlon/internal/pipes/genome.d.ts +16 -2
- package/dist/coordinates/latlon/internal/pipes/genome.js +46 -25
- package/dist/coordinates/latlon/internal/pipes/genome.js.map +1 -1
- package/dist/coordinates/latlon/internal/pipes/index.d.ts +18 -4
- package/dist/coordinates/latlon/internal/pipes/index.js +58 -35
- package/dist/coordinates/latlon/internal/pipes/index.js.map +1 -1
- package/dist/coordinates/latlon/internal/pipes/simpler.d.ts +16 -2
- package/dist/coordinates/latlon/internal/pipes/simpler.js +25 -1
- package/dist/coordinates/latlon/internal/pipes/simpler.js.map +1 -1
- package/dist/coordinates/latlon/internal/violation.d.ts +3 -1
- package/dist/coordinates/latlon/internal/violation.js +15 -1
- package/dist/coordinates/latlon/internal/violation.js.map +1 -1
- package/dist/coordinates/mgrs/parser.d.ts +16 -4
- package/dist/coordinates/mgrs/parser.js +32 -35
- package/dist/coordinates/mgrs/parser.js.map +1 -1
- package/dist/coordinates/mgrs/system.d.ts +16 -5
- package/dist/coordinates/mgrs/system.js +28 -18
- package/dist/coordinates/mgrs/system.js.map +1 -1
- package/dist/coordinates/utm/parser.d.ts +16 -4
- package/dist/coordinates/utm/parser.js +32 -30
- package/dist/coordinates/utm/parser.js.map +1 -1
- package/dist/coordinates/utm/system.d.ts +16 -5
- package/dist/coordinates/utm/system.js +29 -23
- package/dist/coordinates/utm/system.js.map +1 -1
- package/dist/index.d.ts +24 -15
- package/dist/index.js +26 -13
- package/dist/patterning.d.ts +3 -1
- package/dist/patterning.js +75 -11
- package/dist/patterning.js.map +1 -1
- package/package.json +48 -14
- package/dist/coordinates/latlon/internal/coordinate-system.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/metafile-esm.json +0 -1
|
@@ -1,5 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
//#region src/coordinates/latlon/internal/pipes/simpler.ts
|
|
15
|
+
/**
|
|
16
|
+
* Create a simplified pattern string - numbers = 'N', bearings = 'B' - to
|
|
17
|
+
* allow for simpler pattern matching.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* pure function
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* simplify(tokens); // 'NNNBNNNB' or similar
|
|
24
|
+
*/
|
|
1
25
|
const simpler = (tokens) => tokens.map((t) => /\d/.test(t) ? "N" : "B").join("");
|
|
2
26
|
|
|
27
|
+
//#endregion
|
|
3
28
|
export { simpler };
|
|
4
|
-
//# sourceMappingURL=simpler.js.map
|
|
5
29
|
//# sourceMappingURL=simpler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/coordinates/latlon/internal/pipes/simpler.ts"],"
|
|
1
|
+
{"version":3,"file":"simpler.js","names":[],"sources":["../../../../../src/coordinates/latlon/internal/pipes/simpler.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { Tokens } from '../lexer';\n\n/**\n * Create a simplified pattern string - numbers = 'N', bearings = 'B' - to\n * allow for simpler pattern matching.\n *\n * @remarks\n * pure function\n *\n * @example\n * simplify(tokens); // 'NNNBNNNB' or similar\n */\nexport const simpler = (tokens: Tokens) =>\n tokens.map((t) => (/\\d/.test(t) ? 'N' : 'B')).join('');\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,WAAW,WACtB,OAAO,KAAK,MAAO,KAAK,KAAK,EAAE,GAAG,MAAM,IAAK,CAAC,KAAK,GAAG"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
//#region src/coordinates/latlon/internal/violation.ts
|
|
1
15
|
const violation = (s) => `[ERROR] ${s}`;
|
|
2
16
|
|
|
17
|
+
//#endregion
|
|
3
18
|
export { violation };
|
|
4
|
-
//# sourceMappingURL=violation.js.map
|
|
5
19
|
//# sourceMappingURL=violation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"violation.js","names":[],"sources":["../../../../src/coordinates/latlon/internal/violation.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport const violation = (s: string) => `[ERROR] ${s}`;\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,aAAa,MAAc,WAAW"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
import { ParseResults } from "../latlon/internal/parse.js";
|
|
6
14
|
|
|
15
|
+
//#region src/coordinates/mgrs/parser.d.ts
|
|
16
|
+
declare function parseMGRS(_format: any, input: string): ParseResults;
|
|
17
|
+
//#endregion
|
|
7
18
|
export { parseMGRS };
|
|
19
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
4
12
|
|
|
13
|
+
|
|
14
|
+
import { violation } from "../latlon/internal/violation.js";
|
|
15
|
+
import { parse } from "../latlon/internal/parse.js";
|
|
16
|
+
import Mgrs from "geodesy/mgrs";
|
|
17
|
+
|
|
18
|
+
//#region src/coordinates/mgrs/parser.ts
|
|
5
19
|
const PATTERN_PARTS = /^((?:..?)?)(\w?)\s*((?:\w{2})?)\s*(?:(\d+(?:\.\d*)?)?)\s*(?:(\d+(?:\.\d*)?)?)$/i;
|
|
6
|
-
const error = (message) => [
|
|
7
|
-
[],
|
|
8
|
-
[`${violation(message)}; expected format DDZ AA DDD DDD.`]
|
|
9
|
-
];
|
|
20
|
+
const error = (message) => [[], [`${violation(message)}; expected format DDZ AA DDD DDD.`]];
|
|
10
21
|
function detailedErrors(input) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
if (!/[C-HJ-NP-X]/i.test(bnd)) {
|
|
21
|
-
return error(
|
|
22
|
-
`Invalid Latitude band letter (${bnd}) found in grid zone designation`
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
if (!/^[A-HJ-NP-Z]*$/i.test(hkm)) {
|
|
26
|
-
return error(`Invalid 100K m square identification (${hkm}) found`);
|
|
27
|
-
}
|
|
28
|
-
if (!(east && north && +east > 0 && +north > 0)) {
|
|
29
|
-
return error(`Invalid numerical location (${[east, north].join()}) found`);
|
|
30
|
-
}
|
|
31
|
-
return error("Uncaught error condition.");
|
|
22
|
+
if (!input) return error("No input provided");
|
|
23
|
+
const [utm, bnd, hkm, east, north] = (input.trim().replace(/\s+/g, " ").match(PATTERN_PARTS) ?? []).slice(1);
|
|
24
|
+
if (!utm || +utm > 60 || +utm < 1) return error(`Invalid UTM zone number (${utm}) found in grid zone designation`);
|
|
25
|
+
if (!/[C-HJ-NP-X]/i.test(bnd)) return error(`Invalid Latitude band letter (${bnd}) found in grid zone designation`);
|
|
26
|
+
if (!/^[A-HJ-NP-Z]*$/i.test(hkm)) return error(`Invalid 100K m square identification (${hkm}) found`);
|
|
27
|
+
if (!(east && north && +east > 0 && +north > 0)) return error(`Invalid numerical location (${[east, north].join()}) found`);
|
|
28
|
+
return error("Uncaught error condition.");
|
|
32
29
|
}
|
|
33
30
|
function parseMGRS(_format, input) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
try {
|
|
32
|
+
const point = Mgrs.parse(input).toUtm().toLatLon();
|
|
33
|
+
return parse(`${point.lat} / ${point.lon}`, "LATLON");
|
|
34
|
+
} catch (_e) {
|
|
35
|
+
return detailedErrors(input);
|
|
36
|
+
}
|
|
40
37
|
}
|
|
41
38
|
|
|
39
|
+
//#endregion
|
|
42
40
|
export { parseMGRS };
|
|
43
|
-
//# sourceMappingURL=parser.js.map
|
|
44
41
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parser.js","names":[],"sources":["../../../src/coordinates/mgrs/parser.ts"],"sourcesContent":["/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Mgrs from 'geodesy/mgrs';\nimport { type ParseResults, parse } from '../latlon/internal/parse';\nimport { violation } from '../latlon/internal/violation';\n\ntype Match = [string, string, string, string, string];\n\nconst PATTERN_PARTS =\n /^((?:..?)?)(\\w?)\\s*((?:\\w{2})?)\\s*(?:(\\d+(?:\\.\\d*)?)?)\\s*(?:(\\d+(?:\\.\\d*)?)?)$/i;\n\nconst error = (message: string) =>\n [\n [],\n [`${violation(message)}; expected format DDZ AA DDD DDD.`],\n ] as ParseResults;\n\nfunction detailedErrors(input: string) {\n if (!input) {\n return error('No input provided');\n }\n\n const [utm, bnd, hkm, east, north] = (\n input.trim().replace(/\\s+/g, ' ').match(PATTERN_PARTS) ?? []\n ).slice(1) as Match;\n\n if (!utm || +utm > 60 || +utm < 1) {\n return error(\n `Invalid UTM zone number (${utm}) found in grid zone designation`,\n );\n }\n\n if (!/[C-HJ-NP-X]/i.test(bnd)) {\n return error(\n `Invalid Latitude band letter (${bnd}) found in grid zone designation`,\n );\n }\n\n if (!/^[A-HJ-NP-Z]*$/i.test(hkm)) {\n return error(`Invalid 100K m square identification (${hkm}) found`);\n }\n\n if (!(east && north && +east > 0 && +north > 0)) {\n return error(`Invalid numerical location (${[east, north].join()}) found`);\n }\n\n return error('Uncaught error condition.');\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: Format is unused\nexport function parseMGRS(_format: any, input: string) {\n try {\n const point = Mgrs.parse(input).toUtm().toLatLon();\n\n return parse(`${point.lat} / ${point.lon}`, 'LATLON');\n } catch (_e) {\n return detailedErrors(input);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,gBACJ;AAEF,MAAM,SAAS,YACb,CACE,EAAE,EACF,CAAC,GAAG,UAAU,QAAQ,CAAC,mCAAmC,CAC3D;AAEH,SAAS,eAAe,OAAe;AACrC,KAAI,CAAC,MACH,QAAO,MAAM,oBAAoB;CAGnC,MAAM,CAAC,KAAK,KAAK,KAAK,MAAM,UAC1B,MAAM,MAAM,CAAC,QAAQ,QAAQ,IAAI,CAAC,MAAM,cAAc,IAAI,EAAE,EAC5D,MAAM,EAAE;AAEV,KAAI,CAAC,OAAO,CAAC,MAAM,MAAM,CAAC,MAAM,EAC9B,QAAO,MACL,4BAA4B,IAAI,kCACjC;AAGH,KAAI,CAAC,eAAe,KAAK,IAAI,CAC3B,QAAO,MACL,iCAAiC,IAAI,kCACtC;AAGH,KAAI,CAAC,kBAAkB,KAAK,IAAI,CAC9B,QAAO,MAAM,yCAAyC,IAAI,SAAS;AAGrE,KAAI,EAAE,QAAQ,SAAS,CAAC,OAAO,KAAK,CAAC,QAAQ,GAC3C,QAAO,MAAM,+BAA+B,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS;AAG5E,QAAO,MAAM,4BAA4B;;AAI3C,SAAgB,UAAU,SAAc,OAAe;AACrD,KAAI;EACF,MAAM,QAAQ,KAAK,MAAM,MAAM,CAAC,OAAO,CAAC,UAAU;AAElD,SAAO,MAAM,GAAG,MAAM,IAAI,KAAK,MAAM,OAAO,SAAS;UAC9C,IAAI;AACX,SAAO,eAAe,MAAM"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
5
12
|
|
|
6
|
-
|
|
13
|
+
import { CoordinateSystem } from "../latlon/internal/coordinate-system.js";
|
|
7
14
|
|
|
15
|
+
//#region src/coordinates/mgrs/system.d.ts
|
|
16
|
+
declare const systemMGRS: CoordinateSystem;
|
|
17
|
+
//#endregion
|
|
8
18
|
export { systemMGRS };
|
|
19
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
4
12
|
|
|
13
|
+
|
|
14
|
+
import { SYMBOL_PATTERNS } from "../latlon/internal/index.js";
|
|
15
|
+
import { parseMGRS } from "./parser.js";
|
|
16
|
+
import { LatLon } from "geodesy/mgrs";
|
|
17
|
+
|
|
18
|
+
//#region src/coordinates/mgrs/system.ts
|
|
5
19
|
const systemMGRS = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
]);
|
|
17
|
-
const latlon = new LatLon(LAT, LON);
|
|
18
|
-
return latlon.toUtm().toMgrs().toString();
|
|
19
|
-
}
|
|
20
|
+
name: "Military Grid Reference System",
|
|
21
|
+
parse: parseMGRS,
|
|
22
|
+
toFloat(arg) {
|
|
23
|
+
const [num, bear] = arg;
|
|
24
|
+
return Number.parseFloat(num) * (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1);
|
|
25
|
+
},
|
|
26
|
+
toFormat(format, [left, right]) {
|
|
27
|
+
const { LAT, LON } = Object.fromEntries([[format.slice(0, 3), left], [format.slice(3), right]]);
|
|
28
|
+
return new LatLon(LAT, LON).toUtm().toMgrs().toString();
|
|
29
|
+
}
|
|
20
30
|
};
|
|
21
31
|
|
|
32
|
+
//#endregion
|
|
22
33
|
export { systemMGRS };
|
|
23
|
-
//# sourceMappingURL=system.js.map
|
|
24
34
|
//# sourceMappingURL=system.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"system.js","names":["systemMGRS: CoordinateSystem"],"sources":["../../../src/coordinates/mgrs/system.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LatLon } from 'geodesy/mgrs';\nimport { type Compass, type Format, SYMBOL_PATTERNS } from '../latlon/internal';\nimport { parseMGRS } from './parser';\nimport type { CoordinateSystem } from '../latlon/internal/coordinate-system';\n\nexport const systemMGRS: CoordinateSystem = {\n name: 'Military Grid Reference System',\n\n parse: parseMGRS,\n\n toFloat(arg) {\n const [num, bear] = arg as [string, Compass];\n\n return (\n Number.parseFloat(num) *\n (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)\n );\n },\n\n toFormat(format: Format, [left, right]: [number, number]) {\n const { LAT, LON } = Object.fromEntries([\n [format.slice(0, 3), left],\n [format.slice(3), right],\n ]) as Record<'LAT' | 'LON', number>;\n\n const latlon = new LatLon(LAT, LON);\n\n return latlon.toUtm().toMgrs().toString();\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAaA,aAA+B;CAC1C,MAAM;CAEN,OAAO;CAEP,QAAQ,KAAK;EACX,MAAM,CAAC,KAAK,QAAQ;AAEpB,SACE,OAAO,WAAW,IAAI,IACrB,gBAAgB,kBAAkB,KAAK,KAAK,GAAG,KAAK;;CAIzD,SAAS,QAAgB,CAAC,MAAM,QAA0B;EACxD,MAAM,EAAE,KAAK,QAAQ,OAAO,YAAY,CACtC,CAAC,OAAO,MAAM,GAAG,EAAE,EAAE,KAAK,EAC1B,CAAC,OAAO,MAAM,EAAE,EAAE,MAAM,CACzB,CAAC;AAIF,SAFe,IAAI,OAAO,KAAK,IAAI,CAErB,OAAO,CAAC,QAAQ,CAAC,UAAU;;CAE5C"}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
import { ParseResults } from "../latlon/internal/parse.js";
|
|
6
14
|
|
|
15
|
+
//#region src/coordinates/utm/parser.d.ts
|
|
16
|
+
declare function parseUTM(_format: any, input: string): ParseResults;
|
|
17
|
+
//#endregion
|
|
7
18
|
export { parseUTM };
|
|
19
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
4
12
|
|
|
13
|
+
|
|
14
|
+
import { violation } from "../latlon/internal/violation.js";
|
|
15
|
+
import { parse } from "../latlon/internal/parse.js";
|
|
16
|
+
import Utm from "geodesy/utm";
|
|
17
|
+
|
|
18
|
+
//#region src/coordinates/utm/parser.ts
|
|
5
19
|
const PATTERN_PARTS = /^((?:..)?)\s*(\w?)\s*(?:(\d+(?:\.\d*)?)?)\s*(?:(\d+(?:\.\d*)?)?)$/i;
|
|
6
|
-
const error = (message) => [
|
|
7
|
-
[],
|
|
8
|
-
[`${violation(message)}; expected format ZZ N|S DDD DDD.`]
|
|
9
|
-
];
|
|
20
|
+
const error = (message) => [[], [`${violation(message)}; expected format ZZ N|S DDD DDD.`]];
|
|
10
21
|
function detailedErrors(input) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
if (!(east || +east >= 0)) {
|
|
19
|
-
return error(`Invalid Easting number (${east ?? ""}) found`);
|
|
20
|
-
}
|
|
21
|
-
if (!(north || +north >= 0)) {
|
|
22
|
-
return error(`Invalid Northing number (${north ?? ""}) found`);
|
|
23
|
-
}
|
|
24
|
-
return error("Uncaught error condition.");
|
|
22
|
+
const [zone, band, east, north] = (input.trim().replace(/\s+/g, " ").match(PATTERN_PARTS) ?? []).slice(1);
|
|
23
|
+
if (!zone || +zone > 60 || +zone < 1) return error(`Invalid Zone number (${zone}) found`);
|
|
24
|
+
if (!/[NS]/i.test(band)) return error(`Invalid Latitude band letter (${band}) found`);
|
|
25
|
+
if (!(east || +east >= 0)) return error(`Invalid Easting number (${east ?? ""}) found`);
|
|
26
|
+
if (!(north || +north >= 0)) return error(`Invalid Northing number (${north ?? ""}) found`);
|
|
27
|
+
return error("Uncaught error condition.");
|
|
25
28
|
}
|
|
26
29
|
function parseUTM(_format, input) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
30
|
+
try {
|
|
31
|
+
const normalized = input.trim().replace(/^(\d{1,2})([NS])\s+/i, "$1 $2 ");
|
|
32
|
+
const latlon = Utm.parse(normalized).toLatLon();
|
|
33
|
+
return parse(`${latlon.lat} / ${latlon.lon}`, "LATLON");
|
|
34
|
+
} catch (_) {
|
|
35
|
+
return detailedErrors(input);
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
//#endregion
|
|
37
40
|
export { parseUTM };
|
|
38
|
-
//# sourceMappingURL=parser.js.map
|
|
39
41
|
//# sourceMappingURL=parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"parser.js","names":[],"sources":["../../../src/coordinates/utm/parser.ts"],"sourcesContent":["/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Utm from 'geodesy/utm';\nimport { type ParseResults, parse } from '../latlon/internal/parse';\nimport { violation } from '../latlon/internal/violation';\n\ntype Match = [string, string, string, string];\n\nconst PATTERN_PARTS =\n /^((?:..)?)\\s*(\\w?)\\s*(?:(\\d+(?:\\.\\d*)?)?)\\s*(?:(\\d+(?:\\.\\d*)?)?)$/i;\n\nconst error = (message: string) =>\n [\n [],\n [`${violation(message)}; expected format ZZ N|S DDD DDD.`],\n ] as ParseResults;\n\nfunction detailedErrors(input: string) {\n const [zone, band, east, north] = (\n input.trim().replace(/\\s+/g, ' ').match(PATTERN_PARTS) ?? []\n ).slice(1) as Match;\n\n if (!zone || +zone > 60 || +zone < 1) {\n return error(`Invalid Zone number (${zone}) found`);\n }\n\n if (!/[NS]/i.test(band)) {\n return error(`Invalid Latitude band letter (${band}) found`);\n }\n\n if (!(east || +east >= 0)) {\n return error(`Invalid Easting number (${east ?? ''}) found`);\n }\n\n if (!(north || +north >= 0)) {\n return error(`Invalid Northing number (${north ?? ''}) found`);\n }\n\n return error('Uncaught error condition.');\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: Format is unused\nexport function parseUTM(_format: any, input: string) {\n try {\n // Preprocess: ensure space between zone and hemisphere for geodesy parser\n // Convert \"18N 585628 4511644\" to \"18 N 585628 4511644\"\n // The geodesy library requires 4 space-separated elements\n const normalized = input.trim().replace(/^(\\d{1,2})([NS])\\s+/i, '$1 $2 ');\n\n const utm = Utm.parse(normalized);\n const latlon = utm.toLatLon();\n\n return parse(`${latlon.lat} / ${latlon.lon}`, 'LATLON');\n } catch (_) {\n return detailedErrors(input);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,gBACJ;AAEF,MAAM,SAAS,YACb,CACE,EAAE,EACF,CAAC,GAAG,UAAU,QAAQ,CAAC,mCAAmC,CAC3D;AAEH,SAAS,eAAe,OAAe;CACrC,MAAM,CAAC,MAAM,MAAM,MAAM,UACvB,MAAM,MAAM,CAAC,QAAQ,QAAQ,IAAI,CAAC,MAAM,cAAc,IAAI,EAAE,EAC5D,MAAM,EAAE;AAEV,KAAI,CAAC,QAAQ,CAAC,OAAO,MAAM,CAAC,OAAO,EACjC,QAAO,MAAM,wBAAwB,KAAK,SAAS;AAGrD,KAAI,CAAC,QAAQ,KAAK,KAAK,CACrB,QAAO,MAAM,iCAAiC,KAAK,SAAS;AAG9D,KAAI,EAAE,QAAQ,CAAC,QAAQ,GACrB,QAAO,MAAM,2BAA2B,QAAQ,GAAG,SAAS;AAG9D,KAAI,EAAE,SAAS,CAAC,SAAS,GACvB,QAAO,MAAM,4BAA4B,SAAS,GAAG,SAAS;AAGhE,QAAO,MAAM,4BAA4B;;AAI3C,SAAgB,SAAS,SAAc,OAAe;AACpD,KAAI;EAIF,MAAM,aAAa,MAAM,MAAM,CAAC,QAAQ,wBAAwB,SAAS;EAGzE,MAAM,SADM,IAAI,MAAM,WAAW,CACd,UAAU;AAE7B,SAAO,MAAM,GAAG,OAAO,IAAI,KAAK,OAAO,OAAO,SAAS;UAChD,GAAG;AACV,SAAO,eAAe,MAAM"}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
5
12
|
|
|
6
|
-
|
|
13
|
+
import { CoordinateSystem } from "../latlon/internal/coordinate-system.js";
|
|
7
14
|
|
|
15
|
+
//#region src/coordinates/utm/system.d.ts
|
|
16
|
+
declare const systemUTM: CoordinateSystem;
|
|
17
|
+
//#endregion
|
|
8
18
|
export { systemUTM };
|
|
19
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
4
12
|
|
|
13
|
+
|
|
14
|
+
import { SYMBOL_PATTERNS } from "../latlon/internal/index.js";
|
|
15
|
+
import { parseUTM } from "./parser.js";
|
|
16
|
+
import { LatLon } from "geodesy/utm";
|
|
17
|
+
|
|
18
|
+
//#region src/coordinates/utm/system.ts
|
|
5
19
|
const systemUTM = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const latlon = new LatLon(LAT, LON);
|
|
18
|
-
const utm = latlon.toUtm();
|
|
19
|
-
const zone = utm.zone.toString().padStart(2, "0");
|
|
20
|
-
const hemisphere = utm.hemisphere;
|
|
21
|
-
const easting = Math.round(utm.easting).toString();
|
|
22
|
-
const northing = Math.round(utm.northing).toString();
|
|
23
|
-
return `${zone}${hemisphere} ${easting} ${northing}`;
|
|
24
|
-
}
|
|
20
|
+
name: "Universal Transverse Mercator",
|
|
21
|
+
parse: parseUTM,
|
|
22
|
+
toFloat(arg) {
|
|
23
|
+
const [num, bear] = arg;
|
|
24
|
+
return Number.parseFloat(num) * (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1);
|
|
25
|
+
},
|
|
26
|
+
toFormat(format, [left, right]) {
|
|
27
|
+
const { LAT, LON } = Object.fromEntries([[format.slice(0, 3), left], [format.slice(3), right]]);
|
|
28
|
+
const utm = new LatLon(LAT, LON).toUtm();
|
|
29
|
+
return `${utm.zone.toString().padStart(2, "0")}${utm.hemisphere} ${Math.round(utm.easting).toString()} ${Math.round(utm.northing).toString()}`;
|
|
30
|
+
}
|
|
25
31
|
};
|
|
26
32
|
|
|
33
|
+
//#endregion
|
|
27
34
|
export { systemUTM };
|
|
28
|
-
//# sourceMappingURL=system.js.map
|
|
29
35
|
//# sourceMappingURL=system.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"system.js","names":["systemUTM: CoordinateSystem"],"sources":["../../../src/coordinates/utm/system.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2024 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { LatLon } from 'geodesy/utm';\nimport { type Compass, type Format, SYMBOL_PATTERNS } from '../latlon/internal';\nimport { parseUTM } from './parser';\nimport type { CoordinateSystem } from '../latlon/internal/coordinate-system';\n\nexport const systemUTM: CoordinateSystem = {\n name: 'Universal Transverse Mercator',\n\n parse: parseUTM,\n\n toFloat(arg) {\n const [num, bear] = arg as [string, Compass];\n\n return (\n Number.parseFloat(num) *\n (SYMBOL_PATTERNS.NEGATIVE_BEARINGS.test(bear) ? -1 : 1)\n );\n },\n\n toFormat(format: Format, [left, right]: [number, number]) {\n const { LAT, LON } = Object.fromEntries([\n [format.slice(0, 3), left],\n [format.slice(3), right],\n ]) as Record<'LAT' | 'LON', number>;\n\n const latlon = new LatLon(LAT, LON);\n const utm = latlon.toUtm();\n\n // Format UTM coordinates manually to ensure correct format\n // Expected format: \"18N 585628 4511644\" (zone hemisphere easting northing)\n const zone = utm.zone.toString().padStart(2, '0');\n const hemisphere = utm.hemisphere;\n const easting = Math.round(utm.easting).toString();\n const northing = Math.round(utm.northing).toString();\n\n return `${zone}${hemisphere} ${easting} ${northing}`;\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAaA,YAA8B;CACzC,MAAM;CAEN,OAAO;CAEP,QAAQ,KAAK;EACX,MAAM,CAAC,KAAK,QAAQ;AAEpB,SACE,OAAO,WAAW,IAAI,IACrB,gBAAgB,kBAAkB,KAAK,KAAK,GAAG,KAAK;;CAIzD,SAAS,QAAgB,CAAC,MAAM,QAA0B;EACxD,MAAM,EAAE,KAAK,QAAQ,OAAO,YAAY,CACtC,CAAC,OAAO,MAAM,GAAG,EAAE,EAAE,KAAK,EAC1B,CAAC,OAAO,MAAM,EAAE,EAAE,MAAM,CACzB,CAAC;EAGF,MAAM,MADS,IAAI,OAAO,KAAK,IAAI,CAChB,OAAO;AAS1B,SAAO,GALM,IAAI,KAAK,UAAU,CAAC,SAAS,GAAG,IAAI,GAC9B,IAAI,WAIK,GAHZ,KAAK,MAAM,IAAI,QAAQ,CAAC,UAAU,CAGX,GAFtB,KAAK,MAAM,IAAI,SAAS,CAAC,UAAU;;CAIvD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { coordinateSystems, createCoordinate } from "./coordinates/coordinate.js";
|
|
14
|
+
import { FormatOptions, createFormatter } from "./coordinates/latlon/internal/format.js";
|
|
15
|
+
import { formatDecimalDegrees } from "./coordinates/latlon/decimal-degrees/formatter.js";
|
|
16
|
+
import { parseDecimalDegrees } from "./coordinates/latlon/decimal-degrees/parser.js";
|
|
17
|
+
import { formatDegreesDecimalMinutes } from "./coordinates/latlon/degrees-decimal-minutes/formatter.js";
|
|
18
|
+
import { parseDegreesDecimalMinutes } from "./coordinates/latlon/degrees-decimal-minutes/parser.js";
|
|
19
|
+
import { formatDegreesMinutesSeconds } from "./coordinates/latlon/degrees-minutes-seconds/formatter.js";
|
|
20
|
+
import { parseDegreesMinutesSeconds } from "./coordinates/latlon/degrees-minutes-seconds/parser.js";
|
|
21
|
+
import { getOrdinal } from "./coordinates/latlon/internal/ordinal.js";
|
|
22
|
+
import { parseMGRS } from "./coordinates/mgrs/parser.js";
|
|
23
|
+
import { parseUTM } from "./coordinates/utm/parser.js";
|
|
24
|
+
export { type FormatOptions, coordinateSystems, createCoordinate, createFormatter, formatDecimalDegrees, formatDegreesDecimalMinutes, formatDegreesMinutesSeconds, getOrdinal, parseDecimalDegrees, parseDegreesDecimalMinutes, parseDegreesMinutesSeconds, parseMGRS, parseUTM };
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import { parseDecimalDegrees } from "./coordinates/latlon/decimal-degrees/parser.js";
|
|
15
|
+
import { parseDegreesDecimalMinutes } from "./coordinates/latlon/degrees-decimal-minutes/parser.js";
|
|
16
|
+
import { parseDegreesMinutesSeconds } from "./coordinates/latlon/degrees-minutes-seconds/parser.js";
|
|
17
|
+
import { parseMGRS } from "./coordinates/mgrs/parser.js";
|
|
18
|
+
import { parseUTM } from "./coordinates/utm/parser.js";
|
|
19
|
+
import { coordinateSystems, createCoordinate } from "./coordinates/coordinate.js";
|
|
20
|
+
import { getOrdinal } from "./coordinates/latlon/internal/ordinal.js";
|
|
21
|
+
import { createFormatter } from "./coordinates/latlon/internal/format.js";
|
|
22
|
+
import { formatDecimalDegrees } from "./coordinates/latlon/decimal-degrees/formatter.js";
|
|
23
|
+
import { formatDegreesDecimalMinutes } from "./coordinates/latlon/degrees-decimal-minutes/formatter.js";
|
|
24
|
+
import { formatDegreesMinutesSeconds } from "./coordinates/latlon/degrees-minutes-seconds/formatter.js";
|
|
25
|
+
|
|
26
|
+
export { coordinateSystems, createCoordinate, createFormatter, formatDecimalDegrees, formatDegreesDecimalMinutes, formatDegreesMinutesSeconds, getOrdinal, parseDecimalDegrees, parseDegreesDecimalMinutes, parseDegreesMinutesSeconds, parseMGRS, parseUTM };
|