@developmentseed/deck.gl-geotiff 0.3.0-beta.3 → 0.3.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 (92) hide show
  1. package/README.md +33 -4
  2. package/dist/cog-layer.d.ts +34 -27
  3. package/dist/cog-layer.d.ts.map +1 -1
  4. package/dist/cog-layer.js +50 -14
  5. package/dist/cog-layer.js.map +1 -1
  6. package/dist/geotiff/geotiff.d.ts.map +1 -1
  7. package/dist/geotiff/geotiff.js +6 -2
  8. package/dist/geotiff/geotiff.js.map +1 -1
  9. package/dist/geotiff/render-pipeline.d.ts +6 -4
  10. package/dist/geotiff/render-pipeline.d.ts.map +1 -1
  11. package/dist/geotiff/render-pipeline.js +116 -16
  12. package/dist/geotiff/render-pipeline.js.map +1 -1
  13. package/dist/geotiff-layer.d.ts +5 -4
  14. package/dist/geotiff-layer.d.ts.map +1 -1
  15. package/dist/geotiff-layer.js.map +1 -1
  16. package/dist/geotiff-reprojection.d.ts +2 -1
  17. package/dist/geotiff-reprojection.d.ts.map +1 -1
  18. package/dist/geotiff-reprojection.js.map +1 -1
  19. package/dist/index.d.ts +3 -2
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/package.json +12 -12
  24. package/dist/cog-tile-matrix-set.d.ts +0 -3
  25. package/dist/cog-tile-matrix-set.d.ts.map +0 -1
  26. package/dist/cog-tile-matrix-set.js +0 -23
  27. package/dist/cog-tile-matrix-set.js.map +0 -1
  28. package/dist/ellipsoids.d.ts +0 -153
  29. package/dist/ellipsoids.d.ts.map +0 -1
  30. package/dist/ellipsoids.js +0 -153
  31. package/dist/ellipsoids.js.map +0 -1
  32. package/dist/geotiff/high-level/affine.d.ts +0 -16
  33. package/dist/geotiff/high-level/affine.d.ts.map +0 -1
  34. package/dist/geotiff/high-level/affine.js +0 -2
  35. package/dist/geotiff/high-level/affine.js.map +0 -1
  36. package/dist/geotiff/high-level/array.d.ts +0 -37
  37. package/dist/geotiff/high-level/array.d.ts.map +0 -1
  38. package/dist/geotiff/high-level/array.js +0 -2
  39. package/dist/geotiff/high-level/array.js.map +0 -1
  40. package/dist/geotiff/high-level/geotiff.d.ts +0 -63
  41. package/dist/geotiff/high-level/geotiff.d.ts.map +0 -1
  42. package/dist/geotiff/high-level/geotiff.js +0 -135
  43. package/dist/geotiff/high-level/geotiff.js.map +0 -1
  44. package/dist/geotiff/high-level/index.d.ts +0 -8
  45. package/dist/geotiff/high-level/index.d.ts.map +0 -1
  46. package/dist/geotiff/high-level/index.js +0 -5
  47. package/dist/geotiff/high-level/index.js.map +0 -1
  48. package/dist/geotiff/high-level/options.d.ts +0 -11
  49. package/dist/geotiff/high-level/options.d.ts.map +0 -1
  50. package/dist/geotiff/high-level/options.js +0 -2
  51. package/dist/geotiff/high-level/options.js.map +0 -1
  52. package/dist/geotiff/high-level/overview.d.ts +0 -46
  53. package/dist/geotiff/high-level/overview.d.ts.map +0 -1
  54. package/dist/geotiff/high-level/overview.js +0 -124
  55. package/dist/geotiff/high-level/overview.js.map +0 -1
  56. package/dist/geotiff/high-level/tile.d.ts +0 -11
  57. package/dist/geotiff/high-level/tile.d.ts.map +0 -1
  58. package/dist/geotiff/high-level/tile.js +0 -2
  59. package/dist/geotiff/high-level/tile.js.map +0 -1
  60. package/dist/geotiff/high-level/transform.d.ts +0 -23
  61. package/dist/geotiff/high-level/transform.d.ts.map +0 -1
  62. package/dist/geotiff/high-level/transform.js +0 -55
  63. package/dist/geotiff/high-level/transform.js.map +0 -1
  64. package/dist/geotiff/high-level/window.d.ts +0 -23
  65. package/dist/geotiff/high-level/window.d.ts.map +0 -1
  66. package/dist/geotiff/high-level/window.js +0 -31
  67. package/dist/geotiff/high-level/window.js.map +0 -1
  68. package/dist/geotiff/types.d.ts +0 -5
  69. package/dist/geotiff/types.d.ts.map +0 -1
  70. package/dist/geotiff/types.js +0 -7
  71. package/dist/geotiff/types.js.map +0 -1
  72. package/dist/geotiff-types.d.ts +0 -13
  73. package/dist/geotiff-types.d.ts.map +0 -1
  74. package/dist/geotiff-types.js +0 -2
  75. package/dist/geotiff-types.js.map +0 -1
  76. package/dist/geotiff.d.ts +0 -50
  77. package/dist/geotiff.d.ts.map +0 -1
  78. package/dist/geotiff.js +0 -135
  79. package/dist/geotiff.js.map +0 -1
  80. package/dist/mosaic-layer/mosaic-tile-traversal.d.ts +0 -1
  81. package/dist/mosaic-layer/mosaic-tile-traversal.d.ts.map +0 -1
  82. package/dist/mosaic-layer/mosaic-tile-traversal.js +0 -2
  83. package/dist/mosaic-layer/mosaic-tile-traversal.js.map +0 -1
  84. package/dist/mosaic-layer.d.ts +0 -1
  85. package/dist/mosaic-layer.d.ts.map +0 -1
  86. package/dist/mosaic-layer.js +0 -2
  87. package/dist/mosaic-layer.js.map +0 -1
  88. package/dist/texture.d.ts +0 -10
  89. package/dist/texture.d.ts.map +0 -1
  90. package/dist/texture.js +0 -135
  91. package/dist/texture.js.map +0 -1
  92. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,135 +0,0 @@
1
- import { extractGeotransform } from "../../geotiff-reprojection.js";
2
- import { PhotometricInterpretationT } from "../types.js";
3
- import { Overview as OverviewClass } from "./overview.js";
4
- /**
5
- * A higher-level GeoTIFF abstraction that separates data IFDs from mask IFDs,
6
- * pairs them by resolution, and exposes sorted overviews.
7
- *
8
- * Construct via `GeoTIFF.open(tiff)`.
9
- */
10
- export class GeoTIFF {
11
- /** The underlying GeoTIFF instance from geotiff.js */
12
- tiff;
13
- /**
14
- * The primary (first) IFD of the GeoTIFF.
15
- *
16
- * Some tags, like most geo tags, only exist on the primary IFD.
17
- */
18
- primaryIfd;
19
- /**
20
- * The mask IFD of the full-resolution GeoTIFF, if any.
21
- */
22
- maskIfd;
23
- /**
24
- * Reduced-resolution overview levels, sorted finest-to-coarsest.
25
- *
26
- * Does not include the full-resolution image — use `fetchTile` / `read`
27
- * on the GeoTIFF instance itself for that.
28
- */
29
- overviews;
30
- /** Affine geotransform of the full-resolution image. */
31
- transform;
32
- /** The primary (full-resolution) GeoTIFFImage. Useful for geo key access. */
33
- primaryImage;
34
- /** Overview wrapper around the primary image, used by the convenience delegates. */
35
- _primary;
36
- constructor(primary, overviews, transform, primaryImage) {
37
- this._primary = primary;
38
- this.overviews = overviews;
39
- this.transform = transform;
40
- this.primaryImage = primaryImage;
41
- }
42
- /**
43
- * Open a GeoTIFF and classify its IFDs into data/mask pairs.
44
- *
45
- * All IFDs are walked; mask IFDs are matched to data IFDs by matching
46
- * (width, height). Overviews are sorted from finest to coarsest resolution.
47
- */
48
- static async open(tiff) {
49
- const imageCount = await tiff.getImageCount();
50
- if (imageCount === 0) {
51
- throw new Error("TIFF does not contain any IFDs");
52
- }
53
- // Fetch all images and their file directories up front. geotiff.js only
54
- // fetches IFD headers here — raster data is not read until readRasters.
55
- const images = [];
56
- for (let i = 0; i < imageCount; i++) {
57
- images.push(await tiff.getImage(i));
58
- }
59
- const primaryImage = images[0];
60
- const baseTransform = extractGeotransform(primaryImage);
61
- const primaryWidth = primaryImage.getWidth();
62
- // Classify IFDs (skipping index 0) into overview-data and mask buckets
63
- // keyed by "width,height".
64
- const dataIFDs = new Map();
65
- const maskIFDs = new Map();
66
- for (let i = 1; i < images.length; i++) {
67
- const image = images[i];
68
- const key = `${image.getWidth()},${image.getHeight()}`;
69
- if (isMaskIfd(image)) {
70
- maskIFDs.set(key, image);
71
- }
72
- else {
73
- dataIFDs.set(key, image);
74
- }
75
- }
76
- // Build the primary Overview (full-resolution image + its mask, if any)
77
- const primaryKey = `${primaryImage.getWidth()},${primaryImage.getHeight()}`;
78
- const primary = new OverviewClass(primaryImage, maskIFDs.get(primaryKey) ?? null, baseTransform);
79
- // Build reduced-resolution Overview instances, sorted by pixel count
80
- // descending (finest first).
81
- const dataEntries = Array.from(dataIFDs.entries());
82
- dataEntries.sort((a, b) => {
83
- const [wa, ha] = a[0].split(",").map(Number);
84
- const [wb, hb] = b[0].split(",").map(Number);
85
- return wb * hb - wa * ha;
86
- });
87
- const overviews = dataEntries.map(([key, dataImage]) => {
88
- const maskImage = maskIFDs.get(key) ?? null;
89
- const overviewWidth = dataImage.getWidth();
90
- // Scale the base transform for this overview level.
91
- // scale = primaryWidth / overviewWidth
92
- // Scaled: [a*s, b*s, c, d*s, e*s, f] (origin stays the same)
93
- const scale = primaryWidth / overviewWidth;
94
- const [a, b, c, d, e, f] = baseTransform;
95
- const overviewTransform = [
96
- a * scale,
97
- b * scale,
98
- c,
99
- d * scale,
100
- e * scale,
101
- f,
102
- ];
103
- return new OverviewClass(dataImage, maskImage, overviewTransform);
104
- });
105
- return new GeoTIFF(primary, overviews, baseTransform, primaryImage);
106
- }
107
- // ── Convenience delegates to the full-resolution image ─────────────────
108
- /** Fetch a single tile from the full-resolution image. */
109
- async fetchTile(x, y, options) {
110
- return this._primary.fetchTile(x, y, options);
111
- }
112
- /** Read an arbitrary window from the full-resolution image. */
113
- async read(window, options) {
114
- return this._primary.read(window, options);
115
- }
116
- }
117
- /**
118
- * Determine whether a GeoTIFFImage is a mask IFD.
119
- *
120
- * Per the TIFF spec, bit 2 (value 4) of NewSubfileType signals
121
- * "this IFD is a mask". We also require PhotometricInterpretation === 4
122
- * (TransparencyMask) to confirm the intent.
123
- *
124
- * NewSubfileType defaults to 0 when absent from the file directory.
125
- */
126
- export function isMaskIfd(image) {
127
- // getFileDirectory() returns a plain object; NewSubfileType is not in our
128
- // typed ImageFileDirectory, so we access it from the raw directory.
129
- const fd = image.getFileDirectory();
130
- const newSubfileType = fd.NewSubfileType ?? 0;
131
- const photometric = fd.PhotometricInterpretation;
132
- return ((newSubfileType & 4) !== 0 &&
133
- photometric === PhotometricInterpretationT.TransparencyMask);
134
- }
135
- //# sourceMappingURL=geotiff.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geotiff.js","sourceRoot":"","sources":["../../../src/geotiff/high-level/geotiff.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAm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AED,+DAA+D;IAC/D,KAAK,CAAC,IAAI,CAAC,MAAc,EAAE,OAAsB;QAC/C,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,KAAmB;IAC3C,0EAA0E;IAC1E,oEAAoE;IACpE,MAAM,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAA6B,CAAC;IAC/D,MAAM,cAAc,GAAI,EAAE,CAAC,cAAyB,IAAI,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,EAAE,CAAC,yBAAmC,CAAC;IAE3D,OAAO,CACL,CAAC,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC;QAC1B,WAAW,KAAK,0BAA0B,CAAC,gBAAgB,CAC5D,CAAC;AACJ,CAAC"}
@@ -1,8 +0,0 @@
1
- export type { RasterArray } from "./array.js";
2
- export { GeoTIFF, isMaskIfd } from "./geotiff.js";
3
- export type { FetchOptions } from "./options.js";
4
- export { Overview } from "./overview.js";
5
- export type { Tile } from "./tile.js";
6
- export { index, xy } from "./transform.js";
7
- export { createWindow, intersectWindows, type Window } from "./window.js";
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/geotiff/high-level/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC"}
@@ -1,5 +0,0 @@
1
- export { GeoTIFF, isMaskIfd } from "./geotiff.js";
2
- export { Overview } from "./overview.js";
3
- export { index, xy } from "./transform.js";
4
- export { createWindow, intersectWindows } from "./window.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/geotiff/high-level/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAe,MAAM,aAAa,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { Pool } from "geotiff";
2
- /**
3
- * Options for fetching raster data from a GeoTIFF.
4
- */
5
- export type FetchOptions = {
6
- /** GeoTIFF.js decoder pool. If not provided, a default shared pool is used. */
7
- pool?: Pool;
8
- /** AbortSignal to cancel the fetch operation. */
9
- signal?: AbortSignal;
10
- };
11
- //# sourceMappingURL=options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/geotiff/high-level/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,gFAAgF;IAChF,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,iDAAiD;IACjD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/geotiff/high-level/options.ts"],"names":[],"mappings":""}
@@ -1,46 +0,0 @@
1
- import type { GeoTransform } from "@developmentseed/raster-reproject/affine";
2
- import type { GeoTIFFImage } from "geotiff";
3
- import type { RasterArray } from "./array.js";
4
- import type { FetchOptions } from "./options.js";
5
- import type { Tile } from "./tile.js";
6
- import type { Window } from "./window.js";
7
- /**
8
- * A single resolution level of a GeoTIFF — either the full-resolution image or
9
- * an overview. Pairs the data IFD with its corresponding mask IFD (if any).
10
- */
11
- export declare class Overview {
12
- /** The data IFD for this resolution level. */
13
- readonly image: GeoTIFFImage;
14
- /** The mask IFD, or null when no mask exists at this level. */
15
- readonly maskImage: GeoTIFFImage | null;
16
- /** Affine geotransform for this overview's pixel grid. */
17
- readonly transform: GeoTransform;
18
- /** Image width in pixels. */
19
- readonly width: number;
20
- /** Image height in pixels. */
21
- readonly height: number;
22
- /** Tile width in pixels (equals image width when the image is not tiled). */
23
- readonly tileWidth: number;
24
- /** Tile height in pixels (equals image height when the image is not tiled). */
25
- readonly tileHeight: number;
26
- constructor(image: GeoTIFFImage, maskImage: GeoTIFFImage | null, transform: GeoTransform);
27
- /**
28
- * Fetch a single tile by its grid indices.
29
- *
30
- * Edge tiles (at the right or bottom of the image) are clamped to the image
31
- * bounds and will be smaller than tileWidth × tileHeight.
32
- */
33
- fetchTile(x: number, y: number, options?: FetchOptions): Promise<Tile>;
34
- /**
35
- * Read an arbitrary rectangular window of pixel data.
36
- *
37
- * The window is in pixel coordinates of this overview's image.
38
- */
39
- read(window: Window, options?: FetchOptions): Promise<RasterArray>;
40
- /**
41
- * Core read: fetches data (and mask in parallel if present) for the given
42
- * pixel rectangle, and assembles a RasterArray.
43
- */
44
- private _readRegion;
45
- }
46
- //# sourceMappingURL=overview.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../../src/geotiff/high-level/overview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,SAAS,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,qBAAa,QAAQ;IACnB,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,YAAY,GAAG,IAAI,CAAC;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8BAA8B;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAG1B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,YAAY,GAAG,IAAI,EAC9B,SAAS,EAAE,YAAY;IAWzB;;;;;OAKG;IACG,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5E;;;;OAIG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAmBxE;;;OAGG;YACW,WAAW;CAsE1B"}
@@ -1,124 +0,0 @@
1
- import { defaultPool } from "../geotiff.js";
2
- /**
3
- * A single resolution level of a GeoTIFF — either the full-resolution image or
4
- * an overview. Pairs the data IFD with its corresponding mask IFD (if any).
5
- */
6
- export class Overview {
7
- /** The data IFD for this resolution level. */
8
- image;
9
- /** The mask IFD, or null when no mask exists at this level. */
10
- maskImage;
11
- /** Affine geotransform for this overview's pixel grid. */
12
- transform;
13
- /** Image width in pixels. */
14
- width;
15
- /** Image height in pixels. */
16
- height;
17
- /** Tile width in pixels (equals image width when the image is not tiled). */
18
- tileWidth;
19
- /** Tile height in pixels (equals image height when the image is not tiled). */
20
- tileHeight;
21
- constructor(image, maskImage, transform) {
22
- this.image = image;
23
- this.maskImage = maskImage;
24
- this.transform = transform;
25
- this.width = image.getWidth();
26
- this.height = image.getHeight();
27
- this.tileWidth = image.isTiled ? image.getTileWidth() : this.width;
28
- this.tileHeight = image.isTiled ? image.getTileHeight() : this.height;
29
- }
30
- /**
31
- * Fetch a single tile by its grid indices.
32
- *
33
- * Edge tiles (at the right or bottom of the image) are clamped to the image
34
- * bounds and will be smaller than tileWidth × tileHeight.
35
- */
36
- async fetchTile(x, y, options) {
37
- const left = x * this.tileWidth;
38
- const top = y * this.tileHeight;
39
- const right = Math.min(left + this.tileWidth, this.width);
40
- const bottom = Math.min(top + this.tileHeight, this.height);
41
- const array = await this._readRegion(left, top, right, bottom, options);
42
- return { x, y, array };
43
- }
44
- /**
45
- * Read an arbitrary rectangular window of pixel data.
46
- *
47
- * The window is in pixel coordinates of this overview's image.
48
- */
49
- async read(window, options) {
50
- const resolvedPool = options?.pool ?? defaultPool();
51
- const left = window.colOff;
52
- const top = window.rowOff;
53
- const right = left + window.width;
54
- const bottom = top + window.height;
55
- if (right > this.width || bottom > this.height) {
56
- throw new Error(`Window extends outside image bounds. ` +
57
- `Window: cols=${left}:${right}, rows=${top}:${bottom}. ` +
58
- `Image size: ${this.height}x${this.width}`);
59
- }
60
- return this._readRegion(left, top, right, bottom, options);
61
- }
62
- /**
63
- * Core read: fetches data (and mask in parallel if present) for the given
64
- * pixel rectangle, and assembles a RasterArray.
65
- */
66
- async _readRegion(left, top, right, bottom, options) {
67
- const pool = options?.pool ?? defaultPool();
68
- const signal = options?.signal;
69
- // geotiff.js window: [left, top, right, bottom] in pixel coordinates
70
- const window = [left, top, right, bottom];
71
- const dataPromise = this.image.readRasters({
72
- window,
73
- interleave: true,
74
- pool,
75
- signal,
76
- });
77
- const maskPromise = this.maskImage
78
- ? this.maskImage.readRasters({
79
- window,
80
- interleave: true,
81
- pool,
82
- signal,
83
- })
84
- : null;
85
- const [dataResult, maskResult] = await Promise.all([
86
- dataPromise,
87
- maskPromise,
88
- ]);
89
- const height = dataResult.height;
90
- const width = dataResult.width;
91
- const bands = this.image.getSamplesPerPixel();
92
- // Compute the affine transform for this region by translating the overview
93
- // transform by the pixel offset: transform * translate(left, top)
94
- // For [a, b, c, d, e, f]:
95
- // new_c = a * left + b * top + c
96
- // new_f = d * left + e * top + f
97
- const [a, b, c, d, e, f] = this.transform;
98
- const regionTransform = [
99
- a,
100
- b,
101
- a * left + b * top + c,
102
- d,
103
- e,
104
- d * left + e * top + f,
105
- ];
106
- // Mask is single-band; convert to Uint8Array validity mask (1=valid, 0=nodata)
107
- let mask = null;
108
- if (maskResult) {
109
- mask = new Uint8Array(height * width);
110
- for (let i = 0; i < mask.length; i++) {
111
- mask[i] = maskResult[i] !== 0 ? 1 : 0;
112
- }
113
- }
114
- return {
115
- data: dataResult,
116
- mask,
117
- bands,
118
- height,
119
- width,
120
- transform: regionTransform,
121
- };
122
- }
123
- }
124
- //# sourceMappingURL=overview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"overview.js","sourceRoot":"","sources":["../../../src/geotiff/high-level/overview.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACnB,8CAA8C;IACrC,KAAK,CAAe;IAC7B,+DAA+D;IACtD,SAAS,CAAsB;IACxC,0DAA0D;IACjD,SAAS,CAAe;IACjC,6BAA6B;IACpB,KAAK,CAAS;IACvB,8BAA8B;IACrB,MAAM,CAAS;IACxB,6EAA6E;I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AAC,CAAC;YACzC,CAAC;QACH,CAAC;QAED,OAAO;YACL,IAAI,EAAE,UAAU;YAChB,IAAI;YACJ,KAAK;YACL,MAAM;YACN,KAAK;YACL,SAAS,EAAE,eAAe;SAC3B,CAAC;IACJ,CAAC;CACF"}
@@ -1,11 +0,0 @@
1
- import type { RasterArray } from "./array.js";
2
- /** A single tile fetched from a GeoTIFF or Overview. */
3
- export type Tile = {
4
- /** Tile column index in the image's tile grid. */
5
- x: number;
6
- /** Tile row index in the image's tile grid. */
7
- y: number;
8
- /** Decoded raster data for this tile. */
9
- array: RasterArray;
10
- };
11
- //# sourceMappingURL=tile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/geotiff/high-level/tile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,wDAAwD;AACxD,MAAM,MAAM,IAAI,GAAG;IACjB,kDAAkD;IAClD,CAAC,EAAE,MAAM,CAAC;IACV,+CAA+C;IAC/C,CAAC,EAAE,MAAM,CAAC;IACV,yCAAyC;IACzC,KAAK,EAAE,WAAW,CAAC;CACpB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=tile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tile.js","sourceRoot":"","sources":["../../../src/geotiff/high-level/tile.ts"],"names":[],"mappings":""}
@@ -1,23 +0,0 @@
1
- import type { GeoTransform } from "@developmentseed/raster-reproject/affine";
2
- /**
3
- * Get the (row, col) pixel index containing the geographic coordinate (x, y).
4
- *
5
- * @param transform Affine geotransform [a, b, c, d, e, f].
6
- * @param x x coordinate in the CRS.
7
- * @param y y coordinate in the CRS.
8
- * @param op Rounding function applied to fractional pixel indices.
9
- * Defaults to Math.floor.
10
- * @returns [row, col] pixel indices.
11
- */
12
- export declare function index(transform: GeoTransform, x: number, y: number, op?: (n: number) => number): [number, number];
13
- /**
14
- * Get the geographic (x, y) coordinate of the pixel at (row, col).
15
- *
16
- * @param transform Affine geotransform [a, b, c, d, e, f].
17
- * @param row Pixel row.
18
- * @param col Pixel column.
19
- * @param offset Which part of the pixel to return. Defaults to "center".
20
- * @returns [x, y] in the CRS.
21
- */
22
- export declare function xy(transform: GeoTransform, row: number, col: number, offset?: "center" | "ul" | "ur" | "ll" | "lr"): [number, number];
23
- //# sourceMappingURL=transform.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/geotiff/high-level/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAM7E;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CACnB,SAAS,EAAE,YAAY,EACvB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,EAAE,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAmB,GACrC,CAAC,MAAM,EAAE,MAAM,CAAC,CAMlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAChB,SAAS,EAAE,YAAY,EACvB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAe,GACtD,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BlB"}
@@ -1,55 +0,0 @@
1
- import { applyAffine, invertGeoTransform, } from "@developmentseed/raster-reproject/affine";
2
- /**
3
- * Get the (row, col) pixel index containing the geographic coordinate (x, y).
4
- *
5
- * @param transform Affine geotransform [a, b, c, d, e, f].
6
- * @param x x coordinate in the CRS.
7
- * @param y y coordinate in the CRS.
8
- * @param op Rounding function applied to fractional pixel indices.
9
- * Defaults to Math.floor.
10
- * @returns [row, col] pixel indices.
11
- */
12
- export function index(transform, x, y, op = Math.floor) {
13
- const inv = invertGeoTransform(transform);
14
- // applyAffine(col, row, gt) → [x, y], so with the inverse:
15
- // applyAffine(x, y, inv) → [col, row]
16
- const [col, row] = applyAffine(x, y, inv);
17
- return [op(row), op(col)];
18
- }
19
- /**
20
- * Get the geographic (x, y) coordinate of the pixel at (row, col).
21
- *
22
- * @param transform Affine geotransform [a, b, c, d, e, f].
23
- * @param row Pixel row.
24
- * @param col Pixel column.
25
- * @param offset Which part of the pixel to return. Defaults to "center".
26
- * @returns [x, y] in the CRS.
27
- */
28
- export function xy(transform, row, col, offset = "center") {
29
- let c;
30
- let r;
31
- switch (offset) {
32
- case "center":
33
- c = col + 0.5;
34
- r = row + 0.5;
35
- break;
36
- case "ul":
37
- c = col;
38
- r = row;
39
- break;
40
- case "ur":
41
- c = col + 1;
42
- r = row;
43
- break;
44
- case "ll":
45
- c = col;
46
- r = row + 1;
47
- break;
48
- case "lr":
49
- c = col + 1;
50
- r = row + 1;
51
- break;
52
- }
53
- return applyAffine(c, r, transform);
54
- }
55
- //# sourceMappingURL=transform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/geotiff/high-level/transform.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,kBAAkB,GACnB,MAAM,0CAA0C,CAAC;AAElD;;;;;;;;;GASG;AACH,MAAM,UAAU,KAAK,CACnB,SAAuB,EACvB,CAAS,EACT,CAAS,EACT,KAA4B,IAAI,CAAC,KAAK;IAEtC,MAAM,GAAG,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC1C,2DAA2D;IAC3D,sCAAsC;IACtC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,EAAE,CAChB,SAAuB,EACvB,GAAW,EACX,GAAW,EACX,SAA+C,QAAQ;IAEvD,IAAI,CAAS,CAAC;IACd,IAAI,CAAS,CAAC;IAEd,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;YACd,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;YACd,MAAM;QACR,KAAK,IAAI;YACP,CAAC,GAAG,GAAG,CAAC;YACR,CAAC,GAAG,GAAG,CAAC;YACR,MAAM;QACR,KAAK,IAAI;YACP,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YACZ,CAAC,GAAG,GAAG,CAAC;YACR,MAAM;QACR,KAAK,IAAI;YACP,CAAC,GAAG,GAAG,CAAC;YACR,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YACZ,MAAM;QACR,KAAK,IAAI;YACP,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YACZ,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YACZ,MAAM;IACV,CAAC;IAED,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;AACtC,CAAC"}
@@ -1,23 +0,0 @@
1
- /** A rectangular subset of a raster in pixel coordinates. */
2
- export type Window = {
3
- /** Column offset (x position of the left edge). */
4
- colOff: number;
5
- /** Row offset (y position of the top edge). */
6
- rowOff: number;
7
- /** Width in pixels (number of columns). */
8
- width: number;
9
- /** Height in pixels (number of rows). */
10
- height: number;
11
- };
12
- /**
13
- * Create a Window, validating that offsets are non-negative and dimensions are
14
- * positive.
15
- */
16
- export declare function createWindow(colOff: number, rowOff: number, width: number, height: number): Window;
17
- /**
18
- * Compute the intersection of two windows.
19
- *
20
- * Returns null if the windows do not overlap.
21
- */
22
- export declare function intersectWindows(a: Window, b: Window): Window | null;
23
- //# sourceMappingURL=window.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../../src/geotiff/high-level/window.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,MAAM,MAAM,GAAG;IACnB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,MAAM,CAcR;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAcpE"}
@@ -1,31 +0,0 @@
1
- /**
2
- * Create a Window, validating that offsets are non-negative and dimensions are
3
- * positive.
4
- */
5
- export function createWindow(colOff, rowOff, width, height) {
6
- if (colOff < 0 || rowOff < 0) {
7
- throw new Error(`Window offsets must be non-negative, got colOff=${colOff}, rowOff=${rowOff}`);
8
- }
9
- if (width <= 0 || height <= 0) {
10
- throw new Error(`Window dimensions must be positive, got width=${width}, height=${height}`);
11
- }
12
- return { colOff, rowOff, width, height };
13
- }
14
- /**
15
- * Compute the intersection of two windows.
16
- *
17
- * Returns null if the windows do not overlap.
18
- */
19
- export function intersectWindows(a, b) {
20
- const colOff = Math.max(a.colOff, b.colOff);
21
- const rowOff = Math.max(a.rowOff, b.rowOff);
22
- const colStop = Math.min(a.colOff + a.width, b.colOff + b.width);
23
- const rowStop = Math.min(a.rowOff + a.height, b.rowOff + b.height);
24
- const width = colStop - colOff;
25
- const height = rowStop - rowOff;
26
- if (width <= 0 || height <= 0) {
27
- return null;
28
- }
29
- return { colOff, rowOff, width, height };
30
- }
31
- //# sourceMappingURL=window.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"window.js","sourceRoot":"","sources":["../../../src/geotiff/high-level/window.ts"],"names":[],"mappings":"AA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C;IACd,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3C,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare enum PlanarConfigurationT {
2
- Chunky = 1,
3
- Planar = 2
4
- }
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/geotiff/types.ts"],"names":[],"mappings":"AACA,oBAAY,oBAAoB;IAC9B,MAAM,IAAI;IACV,MAAM,IAAI;CACX"}
@@ -1,7 +0,0 @@
1
- // TODO: unused, probably remove
2
- export var PlanarConfigurationT;
3
- (function (PlanarConfigurationT) {
4
- PlanarConfigurationT[PlanarConfigurationT["Chunky"] = 1] = "Chunky";
5
- PlanarConfigurationT[PlanarConfigurationT["Planar"] = 2] = "Planar";
6
- })(PlanarConfigurationT || (PlanarConfigurationT = {}));
7
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/geotiff/types.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,mEAAU,CAAA;IACV,mEAAU,CAAA;AACZ,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
@@ -1,13 +0,0 @@
1
- import type { globals } from "geotiff";
2
- /** Improved typing for IFD. */
3
- export type ImageFileDirectory = {
4
- ImageWidth: number;
5
- ImageLength: number;
6
- BitsPerSample: Uint16Array;
7
- Compression: number;
8
- PhotometricInterpretation: typeof globals.photometricInterpretations;
9
- SamplesPerPixel: number;
10
- SampleFormat: Uint16Array;
11
- PlanarConfiguration: number;
12
- };
13
- //# sourceMappingURL=geotiff-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geotiff-types.d.ts","sourceRoot":"","sources":["../src/geotiff-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,+BAA+B;AAC/B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,WAAW,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB,EAAE,OAAO,OAAO,CAAC,0BAA0B,CAAC;IACrE,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,WAAW,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=geotiff-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geotiff-types.js","sourceRoot":"","sources":["../src/geotiff-types.ts"],"names":[],"mappings":""}