@developmentseed/deck.gl-geotiff 0.1.0-beta.6 → 0.2.0

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 (59) hide show
  1. package/dist/cog-layer.d.ts +114 -9
  2. package/dist/cog-layer.d.ts.map +1 -1
  3. package/dist/cog-layer.js +126 -95
  4. package/dist/cog-layer.js.map +1 -1
  5. package/dist/cog-tile-matrix-set.d.ts +22 -1
  6. package/dist/cog-tile-matrix-set.d.ts.map +1 -1
  7. package/dist/cog-tile-matrix-set.js +25 -24
  8. package/dist/cog-tile-matrix-set.js.map +1 -1
  9. package/dist/ellipsoids.d.ts +1 -1
  10. package/dist/ellipsoids.js +1 -1
  11. package/dist/geotiff/geotiff.d.ts +59 -0
  12. package/dist/geotiff/geotiff.d.ts.map +1 -0
  13. package/dist/geotiff/geotiff.js +146 -0
  14. package/dist/geotiff/geotiff.js.map +1 -0
  15. package/dist/geotiff/index.d.ts +1 -0
  16. package/dist/geotiff/index.d.ts.map +1 -0
  17. package/dist/geotiff/index.js +2 -0
  18. package/dist/geotiff/index.js.map +1 -0
  19. package/dist/geotiff/render-pipeline.d.ts +13 -0
  20. package/dist/geotiff/render-pipeline.d.ts.map +1 -0
  21. package/dist/geotiff/render-pipeline.js +149 -0
  22. package/dist/geotiff/render-pipeline.js.map +1 -0
  23. package/dist/geotiff/texture.d.ts +14 -0
  24. package/dist/geotiff/texture.d.ts.map +1 -0
  25. package/dist/geotiff/texture.js +134 -0
  26. package/dist/geotiff/texture.js.map +1 -0
  27. package/dist/geotiff/types.d.ts +34 -0
  28. package/dist/geotiff/types.d.ts.map +1 -0
  29. package/dist/geotiff/types.js +18 -0
  30. package/dist/geotiff/types.js.map +1 -0
  31. package/dist/geotiff-layer.d.ts +42 -3
  32. package/dist/geotiff-layer.d.ts.map +1 -1
  33. package/dist/geotiff-layer.js +21 -7
  34. package/dist/geotiff-layer.js.map +1 -1
  35. package/dist/geotiff-reprojection.d.ts +5 -11
  36. package/dist/geotiff-reprojection.d.ts.map +1 -1
  37. package/dist/geotiff-reprojection.js +8 -37
  38. package/dist/geotiff-reprojection.js.map +1 -1
  39. package/dist/index.d.ts +12 -4
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +8 -2
  42. package/dist/index.js.map +1 -1
  43. package/dist/mosaic-layer/mosaic-layer.d.ts +31 -0
  44. package/dist/mosaic-layer/mosaic-layer.d.ts.map +1 -0
  45. package/dist/mosaic-layer/mosaic-layer.js +59 -0
  46. package/dist/mosaic-layer/mosaic-layer.js.map +1 -0
  47. package/dist/mosaic-layer/mosaic-tileset-2d.d.ts +42 -0
  48. package/dist/mosaic-layer/mosaic-tileset-2d.d.ts.map +1 -0
  49. package/dist/mosaic-layer/mosaic-tileset-2d.js +44 -0
  50. package/dist/mosaic-layer/mosaic-tileset-2d.js.map +1 -0
  51. package/dist/proj.d.ts +24 -0
  52. package/dist/proj.d.ts.map +1 -0
  53. package/dist/proj.js +46 -0
  54. package/dist/proj.js.map +1 -0
  55. package/package.json +14 -18
  56. package/dist/geotiff.d.ts +0 -31
  57. package/dist/geotiff.d.ts.map +0 -1
  58. package/dist/geotiff.js +0 -70
  59. package/dist/geotiff.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@developmentseed/deck.gl-geotiff",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.2.0",
4
4
  "description": "GeoTIFF and Cloud-Optimized GeoTIFF visualization in deck.gl",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,6 +11,7 @@
11
11
  "default": "./dist/index.js"
12
12
  }
13
13
  },
14
+ "sideEffects": false,
14
15
  "files": [
15
16
  "dist"
16
17
  ],
@@ -32,26 +33,24 @@
32
33
  "url": "git+https://github.com/developmentseed/deck.gl-raster.git"
33
34
  },
34
35
  "devDependencies": {
35
- "@types/node": "^25.0.1",
36
- "@typescript-eslint/eslint-plugin": "^8.16.0",
37
- "@typescript-eslint/parser": "^8.16.0",
38
- "eslint": "^9.15.0",
39
- "jsdom": "^27.2.0",
40
- "prettier": "^3.3.3",
41
- "typescript": "^5.7.2",
42
- "vitest": "^4.0.15"
36
+ "@types/node": "^25.0.3",
37
+ "jsdom": "^27.4.0",
38
+ "typescript": "^5.9.3",
39
+ "vitest": "^4.0.16"
43
40
  },
44
41
  "dependencies": {
42
+ "flatbush": "^4.5.0",
45
43
  "geotiff": "2.1.3",
46
44
  "proj4": "^2.20.2",
47
- "@developmentseed/deck.gl-raster": "^0.1.0-beta.6",
48
- "@developmentseed/raster-reproject": "^0.1.0-beta.6"
45
+ "@developmentseed/raster-reproject": "^0.2.0",
46
+ "@developmentseed/deck.gl-raster": "^0.2.0"
49
47
  },
50
48
  "peerDependencies": {
51
- "@deck.gl/core": "^9.2.5",
52
- "@deck.gl/geo-layers": "^9.2.5",
53
- "@deck.gl/layers": "^9.2.5",
54
- "@deck.gl/mesh-layers": "^9.2.5"
49
+ "@deck.gl/core": "^9.2.6",
50
+ "@deck.gl/geo-layers": "^9.2.6",
51
+ "@deck.gl/layers": "^9.2.6",
52
+ "@deck.gl/mesh-layers": "^9.2.6",
53
+ "@luma.gl/core": "^9.2.6"
55
54
  },
56
55
  "volta": {
57
56
  "extends": "../../package.json"
@@ -60,9 +59,6 @@
60
59
  "build": "tsc --build tsconfig.build.json",
61
60
  "test": "vitest run",
62
61
  "test:watch": "vitest",
63
- "lint": "eslint src --ext .ts,.tsx",
64
- "format": "prettier --write \"src/**/*.{ts,tsx,json}\"",
65
- "format:check": "prettier --check \"src/**/*.{ts,tsx,json}\"",
66
62
  "typecheck": "tsc --noEmit"
67
63
  }
68
64
  }
package/dist/geotiff.d.ts DELETED
@@ -1,31 +0,0 @@
1
- import type { GeoTIFFImage } from "geotiff";
2
- import { Pool } from "geotiff";
3
- /**
4
- * Options that may be passed when reading image data from geotiff.js
5
- */
6
- type ReadRasterOptions = {
7
- /** the subset to read data from in pixels. */
8
- window?: [number, number, number, number];
9
- /** The optional decoder pool to use. */
10
- pool?: Pool;
11
- /** An AbortSignal that may be signalled if the request is to be aborted */
12
- signal?: AbortSignal;
13
- };
14
- /**
15
- * Retrieve the default geotiff.js decoder Pool.
16
- *
17
- * If a Pool has not yet been created, it will be created on first call.
18
- *
19
- * The Pool will be shared between all COGLayer and GeoTIFFLayer instances.
20
- */
21
- export declare function defaultPool(): Pool;
22
- /**
23
- * Load an RGBA image from a GeoTIFFImage.
24
- */
25
- export declare function loadRgbImage(image: GeoTIFFImage, options?: ReadRasterOptions): Promise<{
26
- imageData: ImageData;
27
- height: number;
28
- width: number;
29
- }>;
30
- export {};
31
- //# sourceMappingURL=geotiff.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geotiff.d.ts","sourceRoot":"","sources":["../src/geotiff.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,SAAS,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B;;GAEG;AACH,KAAK,iBAAiB,GAAG;IACvB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAE1C,wCAAwC;IACxC,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AASF;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAMlC;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,YAAY,EACnB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAmBlE"}
package/dist/geotiff.js DELETED
@@ -1,70 +0,0 @@
1
- // Utilities for interacting with geotiff.js.
2
- import { Pool } from "geotiff";
3
- /**
4
- * A default geotiff.js decoder pool instance.
5
- *
6
- * It will be created on first call of `defaultPool`.
7
- */
8
- let DEFAULT_POOL = null;
9
- /**
10
- * Retrieve the default geotiff.js decoder Pool.
11
- *
12
- * If a Pool has not yet been created, it will be created on first call.
13
- *
14
- * The Pool will be shared between all COGLayer and GeoTIFFLayer instances.
15
- */
16
- export function defaultPool() {
17
- if (DEFAULT_POOL === null) {
18
- DEFAULT_POOL = new Pool();
19
- }
20
- return DEFAULT_POOL;
21
- }
22
- /**
23
- * Load an RGBA image from a GeoTIFFImage.
24
- */
25
- export async function loadRgbImage(image, options) {
26
- const mergedOptions = {
27
- ...options,
28
- interleave: true,
29
- enableAlpha: true,
30
- };
31
- // Since we set interleave: true, the result is a single array with all
32
- // samples, so we cast to TypedArrayWithDimensions
33
- // https://github.com/geotiffjs/geotiff.js/issues/486
34
- const rgbImage = (await image.readRGB(mergedOptions));
35
- const imageData = addAlphaChannel(rgbImage);
36
- return {
37
- imageData,
38
- height: rgbImage.height,
39
- width: rgbImage.width,
40
- };
41
- }
42
- /**
43
- * Add an alpha channel to an RGB image array.
44
- *
45
- * Only supports input arrays with 3 (RGB) or 4 (RGBA) channels. If the input is
46
- * already RGBA, it is returned unchanged.
47
- */
48
- function addAlphaChannel(rgbImage) {
49
- const { height, width } = rgbImage;
50
- if (rgbImage.length === height * width * 4) {
51
- // Already has alpha channel
52
- return new ImageData(new Uint8ClampedArray(rgbImage), width, height);
53
- }
54
- else if (rgbImage.length === height * width * 3) {
55
- // Need to add alpha channel
56
- const rgbaLength = (rgbImage.length / 3) * 4;
57
- const rgbaArray = new Uint8ClampedArray(rgbaLength);
58
- for (let i = 0; i < rgbImage.length / 3; ++i) {
59
- rgbaArray[i * 4] = rgbImage[i * 3];
60
- rgbaArray[i * 4 + 1] = rgbImage[i * 3 + 1];
61
- rgbaArray[i * 4 + 2] = rgbImage[i * 3 + 2];
62
- rgbaArray[i * 4 + 3] = 255;
63
- }
64
- return new ImageData(rgbaArray, width, height);
65
- }
66
- else {
67
- throw new Error(`Unexpected number of channels in raster data: ${rgbImage.length / (height * width)}`);
68
- }
69
- }
70
- //# sourceMappingURL=geotiff.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geotiff.js","sourceRoot":"","sources":["../src/geotiff.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAG7C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAgB/B;;;;GAIG;AACH,IAAI,YAAY,GAAgB,IAAI,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW;IACzB,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAAmB,EACnB,OAA2B;IAE3B,MAAM,aAAa,GAAG;QACpB,GAAG,OAAO;QACV,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,IAAI;KAClB,CAAC;IACF,uEAAuE;IACvE,kDAAkD;IAClD,qDAAqD;IACrD,MAAM,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CACnC,aAAa,CACd,CAA6B,CAAC;IAC/B,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAE5C,OAAO;QACL,SAAS;QACT,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,KAAK,EAAE,QAAQ,CAAC,KAAK;KACtB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,eAAe,CAAC,QAAkC;IACzD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,IAAI,QAAQ,CAAC,MAAM,KAAK,MAAM,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;QAC3C,4BAA4B;QAC5B,OAAO,IAAI,SAAS,CAAC,IAAI,iBAAiB,CAAC,QAAQ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