proj4 2.20.7 → 2.20.9

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.
Files changed (127) hide show
  1. package/PUBLISHING.md +2 -2
  2. package/README.md +5 -1
  3. package/changelog.md +4 -0
  4. package/dist/lib/Point.d.ts +24 -0
  5. package/dist/lib/Proj.d.ts +77 -0
  6. package/dist/lib/adjust_axis.d.ts +14 -0
  7. package/dist/lib/checkSanity.d.ts +1 -0
  8. package/dist/lib/common/acosh.d.ts +1 -0
  9. package/dist/lib/common/adjust_lat.d.ts +1 -0
  10. package/dist/lib/common/adjust_lon.d.ts +1 -0
  11. package/dist/lib/common/adjust_zone.d.ts +1 -0
  12. package/dist/lib/common/asinh.d.ts +1 -0
  13. package/dist/lib/common/asinhy.d.ts +1 -0
  14. package/dist/lib/common/asinz.d.ts +1 -0
  15. package/dist/lib/common/atanh.d.ts +1 -0
  16. package/dist/lib/common/authlat.d.ts +1 -0
  17. package/dist/lib/common/authset.d.ts +1 -0
  18. package/dist/lib/common/clens.d.ts +1 -0
  19. package/dist/lib/common/clens_cmplx.d.ts +1 -0
  20. package/dist/lib/common/cosh.d.ts +1 -0
  21. package/dist/lib/common/e0fn.d.ts +1 -0
  22. package/dist/lib/common/e1fn.d.ts +1 -0
  23. package/dist/lib/common/e2fn.d.ts +1 -0
  24. package/dist/lib/common/e3fn.d.ts +1 -0
  25. package/dist/lib/common/fL.d.ts +1 -0
  26. package/dist/lib/common/gN.d.ts +1 -0
  27. package/dist/lib/common/gatg.d.ts +1 -0
  28. package/dist/lib/common/hypot.d.ts +1 -0
  29. package/dist/lib/common/imlfn.d.ts +1 -0
  30. package/dist/lib/common/invlatiso.d.ts +1 -0
  31. package/dist/lib/common/iqsfnz.d.ts +1 -0
  32. package/dist/lib/common/latiso.d.ts +1 -0
  33. package/dist/lib/common/log1py.d.ts +1 -0
  34. package/dist/lib/common/mlfn.d.ts +1 -0
  35. package/dist/lib/common/msfnz.d.ts +1 -0
  36. package/dist/lib/common/phi2z.d.ts +1 -0
  37. package/dist/lib/common/pj_enfn.d.ts +1 -0
  38. package/dist/lib/common/pj_inv_mlfn.d.ts +1 -0
  39. package/dist/lib/common/pj_mlfn.d.ts +1 -0
  40. package/dist/lib/common/qsfnz.d.ts +1 -0
  41. package/dist/lib/common/sign.d.ts +1 -0
  42. package/dist/lib/common/sinh.d.ts +1 -0
  43. package/dist/lib/common/srat.d.ts +1 -0
  44. package/dist/lib/common/tanh.d.ts +1 -0
  45. package/dist/lib/common/toPoint.d.ts +5 -0
  46. package/dist/lib/common/tsfnz.d.ts +1 -0
  47. package/dist/lib/common/vincenty.d.ts +35 -0
  48. package/dist/lib/constants/Datum.d.ts +1823 -0
  49. package/dist/lib/constants/Ellipsoid.d.ts +353 -0
  50. package/dist/lib/constants/PrimeMeridian.d.ts +16 -0
  51. package/dist/lib/constants/units.d.ts +63 -0
  52. package/dist/lib/constants/values.d.ts +19 -0
  53. package/dist/lib/core.d.ts +119 -0
  54. package/dist/lib/datum.d.ts +10 -0
  55. package/dist/lib/datumUtils.d.ts +28 -0
  56. package/dist/lib/datum_transform.d.ts +2 -0
  57. package/dist/lib/defs.d.ts +59 -0
  58. package/dist/lib/deriveConstants.d.ts +11 -0
  59. package/dist/lib/extend.d.ts +1 -0
  60. package/dist/lib/global.d.ts +1 -0
  61. package/dist/lib/includedProjections.d.ts +1 -0
  62. package/dist/lib/index.d.ts +47 -0
  63. package/dist/lib/match.d.ts +1 -0
  64. package/dist/lib/nadgrid.d.ts +107 -0
  65. package/dist/lib/parseCode.d.ts +6 -0
  66. package/dist/lib/projString.d.ts +5 -0
  67. package/dist/lib/projections/aea.d.ts +83 -0
  68. package/dist/lib/projections/aeqd.d.ts +32 -0
  69. package/dist/lib/projections/bonne.d.ts +27 -0
  70. package/dist/lib/projections/cass.d.ts +36 -0
  71. package/dist/lib/projections/cea.d.ts +28 -0
  72. package/dist/lib/projections/eck6.d.ts +45 -0
  73. package/dist/lib/projections/eqc.d.ts +20 -0
  74. package/dist/lib/projections/eqdc.d.ts +71 -0
  75. package/dist/lib/projections/eqearth.d.ts +37 -0
  76. package/dist/lib/projections/equi.d.ts +40 -0
  77. package/dist/lib/projections/etmerc.d.ts +45 -0
  78. package/dist/lib/projections/gauss.d.ts +38 -0
  79. package/dist/lib/projections/geocent.d.ts +22 -0
  80. package/dist/lib/projections/geos.d.ts +51 -0
  81. package/dist/lib/projections/gnom.d.ts +37 -0
  82. package/dist/lib/projections/gstmerc.d.ts +41 -0
  83. package/dist/lib/projections/krovak.d.ts +34 -0
  84. package/dist/lib/projections/laea.d.ts +70 -0
  85. package/dist/lib/projections/lcc.d.ts +36 -0
  86. package/dist/lib/projections/longlat.d.ts +11 -0
  87. package/dist/lib/projections/merc.d.ts +30 -0
  88. package/dist/lib/projections/mill.d.ts +11 -0
  89. package/dist/lib/projections/moll.d.ts +17 -0
  90. package/dist/lib/projections/nzmg.d.ts +33 -0
  91. package/dist/lib/projections/ob_tran.d.ts +80 -0
  92. package/dist/lib/projections/omerc.d.ts +60 -0
  93. package/dist/lib/projections/ortho.d.ts +25 -0
  94. package/dist/lib/projections/poly.d.ts +32 -0
  95. package/dist/lib/projections/qsc.d.ts +31 -0
  96. package/dist/lib/projections/robin.d.ts +24 -0
  97. package/dist/lib/projections/sinu.d.ts +38 -0
  98. package/dist/lib/projections/somerc.d.ts +35 -0
  99. package/dist/lib/projections/stere.d.ts +52 -0
  100. package/dist/lib/projections/sterea.d.ts +33 -0
  101. package/dist/lib/projections/tmerc.d.ts +38 -0
  102. package/dist/lib/projections/tpers.d.ts +45 -0
  103. package/dist/lib/projections/utm.d.ts +19 -0
  104. package/dist/lib/projections/vandg.d.ts +28 -0
  105. package/dist/lib/projections.d.ts +19 -0
  106. package/dist/lib/transform.d.ts +17 -0
  107. package/dist/proj4-src.js +396 -306
  108. package/dist/proj4.js +1 -1
  109. package/dist/projs.d.ts +1 -0
  110. package/lib/Proj.js +2 -0
  111. package/lib/adjust_axis.js +58 -36
  112. package/lib/common/authlat.js +4 -0
  113. package/lib/common/authset.js +20 -0
  114. package/lib/core.js +21 -21
  115. package/lib/datum.js +2 -6
  116. package/lib/includedProjections.js +2 -0
  117. package/lib/nadgrid.js +9 -20
  118. package/lib/projections/eck6.js +38 -0
  119. package/lib/projections/eqearth.js +39 -2
  120. package/lib/projections/laea.js +2 -28
  121. package/lib/projections/ob_tran.js +2 -2
  122. package/lib/projections/omerc.js +4 -0
  123. package/lib/transform.js +26 -18
  124. package/package.json +13 -3
  125. package/projs.js +2 -0
  126. package/tsconfig.json +1 -0
  127. package/publish.sh +0 -21
package/PUBLISHING.md CHANGED
@@ -5,7 +5,7 @@ Publishing
5
5
 
6
6
  1. Make sure you have the latest from the main branch:
7
7
 
8
- git pull origin master
8
+ git pull origin main
9
9
 
10
10
  2. Update `changelog.md` with the changes since the last release, then commit:
11
11
 
@@ -31,4 +31,4 @@ Publishing
31
31
  npm version x.y.(z+1)-alpha --no-git-tag-version
32
32
  git add package.json package-lock.json
33
33
  git commit -m 'update version to x.y.(z+1)-alpha'
34
- git push origin master
34
+ git push origin main
package/README.md CHANGED
@@ -14,7 +14,11 @@ npm install proj4
14
14
 
15
15
  or download `dist.zip` from the [latest release](https://github.com/proj4js/proj4js/releases) and grab `proj4.js` from it.
16
16
 
17
- If you do not want to download anything, Proj4js is also hosted on [cdnjs](https://www.cdnjs.com/libraries/proj4js) for direct use in your browser applications.
17
+ If you do not want to download anything, Proj4js is also available via [jsDelivr](https://www.jsdelivr.com/package/npm/proj4) for direct use in your browser applications:
18
+
19
+ ```html
20
+ <script src="https://cdn.jsdelivr.net/npm/proj4/dist/proj4.js"></script>
21
+ ```
18
22
 
19
23
  ## Using
20
24
 
package/changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Change log
2
2
 
3
+ - 2.20.9: Add Eckert VI (eck6) projection; add geotiff@3 support (geotiff is now an optional peer dependency); fix unknown datum handling to match PROJ behavior; fix gamma without alpha in omerc; fix ob_tran lam offset and +over handling; fix enforceAxis for z and arbitrary axis orders
4
+
5
+ - 2.20.8: Add back TypeScript type definitions to the npm package (accidentally removed in 2.20.7)
6
+
3
7
  - 2.20.7: GitHub releases now contain a separate dist.zip file, so users don't have to find the dist folder in the downloaded source code any more; removed bower.json and component.json; trusted OIDC publishing for the npm package; added security policy; vitest instead of mocha for the tests; removed grunt; renamed main branch to main
4
8
 
5
9
  - 2.20.0: Include WGS84 UTM zones 1-60 North/South and WGS84 UPS North/South; add support for `+over`; add general oblique transformation; make projjson work with `proj4.defs(code, projjson)`
@@ -0,0 +1,24 @@
1
+ export default Point;
2
+ /**
3
+ * @deprecated v3.0.0 - use proj4.toPoint instead
4
+ * @param {number | import('./core').TemplateCoordinates | string} x
5
+ * @param {number} [y]
6
+ * @param {number} [z]
7
+ */
8
+ declare function Point(x: number | import("./core").TemplateCoordinates | string, y?: number, z?: number): Point;
9
+ declare class Point {
10
+ /**
11
+ * @deprecated v3.0.0 - use proj4.toPoint instead
12
+ * @param {number | import('./core').TemplateCoordinates | string} x
13
+ * @param {number} [y]
14
+ * @param {number} [z]
15
+ */
16
+ constructor(x: number | import("./core").TemplateCoordinates | string, y?: number, z?: number);
17
+ x: string | number;
18
+ y: number;
19
+ z: number;
20
+ toMGRS(accuracy: any): any;
21
+ }
22
+ declare namespace Point {
23
+ function fromMGRS(mgrsStr: any): Point;
24
+ }
@@ -0,0 +1,77 @@
1
+ export default Projection;
2
+ export type DatumDefinition = {
3
+ /**
4
+ * - The type of datum.
5
+ */
6
+ datum_type: number;
7
+ /**
8
+ * - Semi-major axis of the ellipsoid.
9
+ */
10
+ a: number;
11
+ /**
12
+ * - Semi-minor axis of the ellipsoid.
13
+ */
14
+ b: number;
15
+ /**
16
+ * - Eccentricity squared of the ellipsoid.
17
+ */
18
+ es: number;
19
+ /**
20
+ * - Second eccentricity squared of the ellipsoid.
21
+ */
22
+ ep2: number;
23
+ };
24
+ /**
25
+ * @typedef {Object} DatumDefinition
26
+ * @property {number} datum_type - The type of datum.
27
+ * @property {number} a - Semi-major axis of the ellipsoid.
28
+ * @property {number} b - Semi-minor axis of the ellipsoid.
29
+ * @property {number} es - Eccentricity squared of the ellipsoid.
30
+ * @property {number} ep2 - Second eccentricity squared of the ellipsoid.
31
+ */
32
+ /**
33
+ * @param {string | import('./core').PROJJSONDefinition | import('./defs').ProjectionDefinition} srsCode
34
+ * @param {(errorMessage?: string, instance?: Projection) => void} [callback]
35
+ */
36
+ declare function Projection(srsCode: string | import("./core").PROJJSONDefinition | import("./defs").ProjectionDefinition, callback?: (errorMessage?: string, instance?: Projection) => void): Projection;
37
+ declare class Projection {
38
+ /**
39
+ * @typedef {Object} DatumDefinition
40
+ * @property {number} datum_type - The type of datum.
41
+ * @property {number} a - Semi-major axis of the ellipsoid.
42
+ * @property {number} b - Semi-minor axis of the ellipsoid.
43
+ * @property {number} es - Eccentricity squared of the ellipsoid.
44
+ * @property {number} ep2 - Second eccentricity squared of the ellipsoid.
45
+ */
46
+ /**
47
+ * @param {string | import('./core').PROJJSONDefinition | import('./defs').ProjectionDefinition} srsCode
48
+ * @param {(errorMessage?: string, instance?: Projection) => void} [callback]
49
+ */
50
+ constructor(srsCode: string | import("./core").PROJJSONDefinition | import("./defs").ProjectionDefinition, callback?: (errorMessage?: string, instance?: Projection) => void);
51
+ /** @type {<T extends import('./core').TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T} */
52
+ forward: <T extends import("./core").TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T;
53
+ /** @type {<T extends import('./core').TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T} */
54
+ inverse: <T extends import("./core").TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T;
55
+ /** @type {function(): void} */
56
+ init: () => void;
57
+ /** @type {string} */
58
+ name: string;
59
+ /** @type {string} */
60
+ axis: string;
61
+ /** @type {Array<string>} */
62
+ names: Array<string>;
63
+ /** @type {string} */
64
+ title: string;
65
+ a: any;
66
+ b: any;
67
+ rf: any;
68
+ sphere: any;
69
+ es: number;
70
+ e: number;
71
+ ep2: number;
72
+ datum: DatumDefinition;
73
+ }
74
+ declare namespace Projection {
75
+ export { projections };
76
+ }
77
+ import projections from './projections';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Convert a point in a given CRS axis order to ENU (east/north/up) order
3
+ * @param {import('./defs').ProjectionDefinition} crs
4
+ * @param {import('./core').InterfaceCoordinates} point
5
+ * @returns {import('./core').InterfaceCoordinates | null}
6
+ */
7
+ export function adjustAxisToEnu(crs: import("./defs").ProjectionDefinition, point: import("./core").InterfaceCoordinates): import("./core").InterfaceCoordinates | null;
8
+ /**
9
+ * Convert a point in ENU (east/north/up) order to the given CRS axis order.
10
+ * @param {import('./defs').ProjectionDefinition} crs
11
+ * @param {import('./core').InterfaceCoordinates} point
12
+ * @returns {import('./core').InterfaceCoordinates | null}
13
+ */
14
+ export function adjustAxisFromEnu(crs: import("./defs").ProjectionDefinition, point: import("./core").InterfaceCoordinates): import("./core").InterfaceCoordinates | null;
@@ -0,0 +1 @@
1
+ export default function _default(point: any): void;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): any;
@@ -0,0 +1 @@
1
+ export default function _default(x: any, skipAdjust: any): any;
@@ -0,0 +1 @@
1
+ export default function _default(zone: any, lon: any): any;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function authlat(beta: any, APA: any): any;
@@ -0,0 +1 @@
1
+ export default function authset(es: any): number[];
@@ -0,0 +1 @@
1
+ export default function _default(pp: any, arg_r: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(pp: any, arg_r: any, arg_i: any): number[];
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any, L: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(a: any, e: any, sinphi: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(pp: any, B: any): any;
@@ -0,0 +1 @@
1
+ export default function _default(x: any, y: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(ml: any, e0: any, e1: any, e2: any, e3: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(eccent: any, ts: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(eccent: any, q: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(eccent: any, phi: any, sinphi: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): any;
@@ -0,0 +1 @@
1
+ export default function _default(e0: any, e1: any, e2: any, e3: any, phi: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(eccent: any, sinphi: any, cosphi: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(eccent: any, ts: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(es: any): number[];
@@ -0,0 +1 @@
1
+ export default function _default(arg: any, es: any, en: any): any;
@@ -0,0 +1 @@
1
+ export default function _default(phi: any, sphi: any, cphi: any, en: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(eccent: any, sinphi: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): 1 | -1;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(esinp: any, exp: any): number;
@@ -0,0 +1 @@
1
+ export default function _default(x: any): number;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @param {Array<number>} array
3
+ * @returns {import("../core").InterfaceCoordinates}
4
+ */
5
+ export default function _default(array: Array<number>): import("../core").InterfaceCoordinates;
@@ -0,0 +1 @@
1
+ export default function _default(eccent: any, phi: any, sinphi: any): number;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Calculates the inverse geodesic problem using Vincenty's formulae.
3
+ * Computes the forward azimuth and ellipsoidal distance between two points
4
+ * specified by latitude and longitude on the surface of an ellipsoid.
5
+ *
6
+ * @param {number} lat1 Latitude of the first point in radians.
7
+ * @param {number} lon1 Longitude of the first point in radians.
8
+ * @param {number} lat2 Latitude of the second point in radians.
9
+ * @param {number} lon2 Longitude of the second point in radians.
10
+ * @param {number} a Semi-major axis of the ellipsoid (meters).
11
+ * @param {number} f Flattening of the ellipsoid.
12
+ * @returns {{ azi1: number, s12: number }} An object containing:
13
+ * - azi1: Forward azimuth from the first point to the second point (radians).
14
+ * - s12: Ellipsoidal distance between the two points (meters).
15
+ */
16
+ export function vincentyInverse(lat1: number, lon1: number, lat2: number, lon2: number, a: number, f: number): {
17
+ azi1: number;
18
+ s12: number;
19
+ };
20
+ /**
21
+ * Solves the direct geodetic problem using Vincenty's formulae.
22
+ * Given a starting point, initial azimuth, and distance, computes the destination point on the ellipsoid.
23
+ *
24
+ * @param {number} lat1 Latitude of the starting point in radians.
25
+ * @param {number} lon1 Longitude of the starting point in radians.
26
+ * @param {number} azi1 Initial azimuth (forward azimuth) in radians.
27
+ * @param {number} s12 Distance to travel from the starting point in meters.
28
+ * @param {number} a Semi-major axis of the ellipsoid in meters.
29
+ * @param {number} f Flattening of the ellipsoid.
30
+ * @returns {{lat2: number, lon2: number}} The latitude and longitude (in radians) of the destination point.
31
+ */
32
+ export function vincentyDirect(lat1: number, lon1: number, azi1: number, s12: number, a: number, f: number): {
33
+ lat2: number;
34
+ lon2: number;
35
+ };