proj4 2.20.8 → 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.
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)`
@@ -56,6 +56,8 @@ declare class Projection {
56
56
  init: () => void;
57
57
  /** @type {string} */
58
58
  name: string;
59
+ /** @type {string} */
60
+ axis: string;
59
61
  /** @type {Array<string>} */
60
62
  names: Array<string>;
61
63
  /** @type {string} */
@@ -1 +1,14 @@
1
- export default function _default(crs: any, denorm: any, point: any): import("./core").InterfaceCoordinates;
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 authlat(beta: any, APA: any): any;
@@ -0,0 +1 @@
1
+ export default function authset(es: any): number[];
@@ -9,10 +9,10 @@ export default function nadgrid(key: string, data: ArrayBuffer, options?: NTV2Gr
9
9
  /**
10
10
  * @overload
11
11
  * @param {string} key - The key to associate with the loaded grid.
12
- * @param {GeoTIFF} data - The GeoTIFF instance to read the grid from.
12
+ * @param {import('geotiff').GeoTIFF} data - The GeoTIFF instance to read the grid from.
13
13
  * @returns {{ready: Promise<NADGrid>}} - A promise that resolves to the loaded grid information.
14
14
  */
15
- export default function nadgrid(key: string, data: GeoTIFF): {
15
+ export default function nadgrid(key: string, data: import("geotiff").GeoTIFF): {
16
16
  ready: Promise<NADGrid>;
17
17
  };
18
18
  /**
@@ -105,37 +105,3 @@ export type NADGrid = {
105
105
  header: NadgridHeader;
106
106
  subgrids: Array<Subgrid>;
107
107
  };
108
- export type GeoTIFF = {
109
- /**
110
- * - Returns the number of images in the GeoTIFF.
111
- */
112
- getImageCount: () => Promise<number>;
113
- /**
114
- * - Returns a GeoTIFFImage for the given index.
115
- */
116
- getImage: (index: number) => Promise<GeoTIFFImage>;
117
- };
118
- export type GeoTIFFImage = {
119
- /**
120
- * - Returns the width of the image.
121
- */
122
- getWidth: () => number;
123
- /**
124
- * - Returns the height of the image.
125
- */
126
- getHeight: () => number;
127
- /**
128
- * - Returns the bounding box as [minX, minY, maxX, maxY] in degrees.
129
- */
130
- getBoundingBox: () => number[];
131
- /**
132
- * - Returns the raster data as an array of bands.
133
- */
134
- readRasters: () => Promise<ArrayLike<ArrayLike<number>>>;
135
- /**
136
- * - The file directory object containing metadata.
137
- */
138
- fileDirectory: {
139
- ModelPixelScale: any;
140
- };
141
- };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Eckert VI projection — spherical sinusoidal variant with m=1, n=1+π/2.
3
+ * Always forces spherical computation regardless of the ellipsoid.
4
+ *
5
+ * @typedef {Object} LocalThis
6
+ * @property {number} m
7
+ * @property {number} n
8
+ * @property {number} C_y
9
+ * @property {number} C_x
10
+ * @property {number} es
11
+ */
12
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
13
+ export function init(this: import("../defs.js").ProjectionDefinition & LocalThis): void;
14
+ export class init {
15
+ sphere: boolean;
16
+ b: number;
17
+ m: number;
18
+ n: number;
19
+ es: number;
20
+ C_y: number;
21
+ C_x: number;
22
+ }
23
+ export const forward: typeof sinuForward;
24
+ export const inverse: typeof sinuInverse;
25
+ export const names: string[];
26
+ declare namespace _default {
27
+ export { init };
28
+ export { forward };
29
+ export { inverse };
30
+ export { names };
31
+ }
32
+ export default _default;
33
+ /**
34
+ * Eckert VI projection — spherical sinusoidal variant with m=1, n=1+π/2.
35
+ * Always forces spherical computation regardless of the ellipsoid.
36
+ */
37
+ export type LocalThis = {
38
+ m: number;
39
+ n: number;
40
+ C_y: number;
41
+ C_x: number;
42
+ es: number;
43
+ };
44
+ import { forward as sinuForward } from './sinu';
45
+ import { inverse as sinuInverse } from './sinu';
@@ -1,12 +1,25 @@
1
- export function init(): void;
1
+ /**
2
+ * @typedef {Object} LocalThis
3
+ * @property {number} es
4
+ * @property {number} e
5
+ * @property {Array<number>} apa
6
+ * @property {number} qp
7
+ * @property {number} rqda
8
+ */
9
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
10
+ export function init(this: import("../defs.js").ProjectionDefinition & LocalThis): void;
2
11
  export class init {
3
- es: number;
4
12
  long0: number;
5
13
  x0: number;
6
14
  y0: number;
15
+ apa: number[];
16
+ qp: number;
17
+ rqda: number;
7
18
  }
8
- export function forward(p: any): any;
9
- export function inverse(p: any): any;
19
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
20
+ export function forward(this: import("../defs.js").ProjectionDefinition & LocalThis, p: any): any;
21
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
22
+ export function inverse(this: import("../defs.js").ProjectionDefinition & LocalThis, p: any): any;
10
23
  export const names: string[];
11
24
  declare namespace _default {
12
25
  export { init };
@@ -15,3 +28,10 @@ declare namespace _default {
15
28
  export { names };
16
29
  }
17
30
  export default _default;
31
+ export type LocalThis = {
32
+ es: number;
33
+ e: number;
34
+ apa: Array<number>;
35
+ qp: number;
36
+ rqda: number;
37
+ };
@@ -1,8 +1,17 @@
1
+ /**
2
+ * Internal transform: accepts an already-cloned point object, returns transformed point object.
3
+ * @param {import('./defs').ProjectionDefinition} source
4
+ * @param {import('./defs').ProjectionDefinition} dest
5
+ * @param {import('./core').InterfaceCoordinates} point
6
+ * @param {boolean} [enforceAxis]
7
+ * @returns {import('./core').InterfaceCoordinates | undefined}
8
+ */
9
+ export function transformInternal(source: import("./defs").ProjectionDefinition, dest: import("./defs").ProjectionDefinition, point: import("./core").InterfaceCoordinates, enforceAxis?: boolean): import("./core").InterfaceCoordinates | undefined;
1
10
  /**
2
11
  * @param {import('./defs').ProjectionDefinition} source
3
12
  * @param {import('./defs').ProjectionDefinition} dest
4
13
  * @param {import('./core').TemplateCoordinates} point
5
- * @param {boolean} enforceAxis
14
+ * @param {boolean} [enforceAxis]
6
15
  * @returns {import('./core').InterfaceCoordinates | undefined}
7
16
  */
8
- export default function transform(source: import("./defs").ProjectionDefinition, dest: import("./defs").ProjectionDefinition, point: import("./core").TemplateCoordinates, enforceAxis: boolean): import("./core").InterfaceCoordinates | undefined;
17
+ export default function transform(source: import("./defs").ProjectionDefinition, dest: import("./defs").ProjectionDefinition, point: import("./core").TemplateCoordinates, enforceAxis?: boolean): import("./core").InterfaceCoordinates | undefined;