geotiff 3.0.0 → 3.0.2
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/dist-browser/geotiff.js +3 -2
- package/dist-browser/geotiff.js.map +1 -1
- package/dist-module/compression/basedecoder.d.ts +4 -0
- package/dist-module/compression/basedecoder.d.ts.map +1 -1
- package/dist-module/compression/basedecoder.js +6 -0
- package/dist-module/compression/index.d.ts +4 -4
- package/dist-module/compression/index.d.ts.map +1 -1
- package/dist-module/compression/index.js +4 -4
- package/dist-module/compression/jpeg.d.ts +6 -1
- package/dist-module/compression/jpeg.d.ts.map +1 -1
- package/dist-module/compression/jpeg.js +50 -5
- package/dist-module/compression/lzw.js +1 -1
- package/dist-module/compression/webimage.d.ts +1 -1
- package/dist-module/compression/webimage.d.ts.map +1 -1
- package/dist-module/compression/webimage.js +1 -1
- package/dist-module/dataslice.d.ts.map +1 -1
- package/dist-module/dataslice.js +2 -2
- package/dist-module/dataview64.d.ts +2 -2
- package/dist-module/dataview64.d.ts.map +1 -1
- package/dist-module/dataview64.js +4 -4
- package/dist-module/geotiff.d.ts +171 -45
- package/dist-module/geotiff.d.ts.map +1 -1
- package/dist-module/geotiff.js +119 -20
- package/dist-module/geotiffimage.d.ts +79 -112
- package/dist-module/geotiffimage.d.ts.map +1 -1
- package/dist-module/geotiffimage.js +99 -71
- package/dist-module/geotiffwriter.js +2 -2
- package/dist-module/globals.d.ts +48 -40
- package/dist-module/globals.d.ts.map +1 -1
- package/dist-module/globals.js +14 -10
- package/dist-module/imagefiledirectory.d.ts +2 -2
- package/dist-module/imagefiledirectory.d.ts.map +1 -1
- package/dist-module/imagefiledirectory.js +23 -12
- package/dist-module/logging.js +7 -7
- package/dist-module/pool.js +1 -1
- package/dist-module/predictor.js +1 -1
- package/dist-module/resample.d.ts +18 -18
- package/dist-module/resample.d.ts.map +1 -1
- package/dist-module/resample.js +12 -12
- package/dist-module/source/basesource.d.ts +7 -7
- package/dist-module/source/basesource.d.ts.map +1 -1
- package/dist-module/source/basesource.js +7 -7
- package/dist-module/source/blockedsource.d.ts +10 -10
- package/dist-module/source/blockedsource.d.ts.map +1 -1
- package/dist-module/source/blockedsource.js +12 -9
- package/dist-module/source/client/base.d.ts +8 -10
- package/dist-module/source/client/base.d.ts.map +1 -1
- package/dist-module/source/client/base.js +4 -3
- package/dist-module/source/client/fetch.d.ts +2 -7
- package/dist-module/source/client/fetch.d.ts.map +1 -1
- package/dist-module/source/client/fetch.js +7 -2
- package/dist-module/source/client/http.d.ts +4 -1
- package/dist-module/source/client/http.d.ts.map +1 -1
- package/dist-module/source/client/http.js +4 -4
- package/dist-module/source/client/xhr.d.ts +4 -1
- package/dist-module/source/client/xhr.d.ts.map +1 -1
- package/dist-module/source/client/xhr.js +1 -1
- package/dist-module/source/file.js +4 -4
- package/dist-module/source/filereader.js +1 -1
- package/dist-module/source/httputils.d.ts +14 -6
- package/dist-module/source/httputils.d.ts.map +1 -1
- package/dist-module/source/httputils.js +13 -12
- package/dist-module/source/remote.d.ts +31 -22
- package/dist-module/source/remote.d.ts.map +1 -1
- package/dist-module/source/remote.js +37 -13
- package/dist-module/utils.d.ts +7 -1
- package/dist-module/utils.d.ts.map +1 -1
- package/dist-module/utils.js +6 -0
- package/dist-module/worker/create.js +1 -1
- package/dist-node/compression/basedecoder.d.ts +4 -0
- package/dist-node/compression/basedecoder.d.ts.map +1 -1
- package/dist-node/compression/basedecoder.js +6 -0
- package/dist-node/compression/basedecoder.js.map +1 -1
- package/dist-node/compression/index.d.ts +4 -4
- package/dist-node/compression/index.d.ts.map +1 -1
- package/dist-node/compression/index.js +4 -4
- package/dist-node/compression/jpeg.d.ts +6 -1
- package/dist-node/compression/jpeg.d.ts.map +1 -1
- package/dist-node/compression/jpeg.js +50 -5
- package/dist-node/compression/jpeg.js.map +1 -1
- package/dist-node/compression/lzw.js +1 -1
- package/dist-node/compression/lzw.js.map +1 -1
- package/dist-node/compression/webimage.js +1 -1
- package/dist-node/compression/webimage.js.map +1 -1
- package/dist-node/dataslice.js +2 -2
- package/dist-node/dataslice.js.map +1 -1
- package/dist-node/dataview64.d.ts +2 -2
- package/dist-node/dataview64.d.ts.map +1 -1
- package/dist-node/dataview64.js +4 -4
- package/dist-node/dataview64.js.map +1 -1
- package/dist-node/geotiff.d.ts +171 -45
- package/dist-node/geotiff.d.ts.map +1 -1
- package/dist-node/geotiff.js +118 -20
- package/dist-node/geotiff.js.map +1 -1
- package/dist-node/geotiffimage.d.ts +80 -113
- package/dist-node/geotiffimage.d.ts.map +1 -1
- package/dist-node/geotiffimage.js +99 -71
- package/dist-node/geotiffimage.js.map +1 -1
- package/dist-node/geotiffwriter.js +2 -2
- package/dist-node/geotiffwriter.js.map +1 -1
- package/dist-node/globals.d.ts +48 -40
- package/dist-node/globals.d.ts.map +1 -1
- package/dist-node/globals.js +14 -10
- package/dist-node/globals.js.map +1 -1
- package/dist-node/imagefiledirectory.d.ts +2 -2
- package/dist-node/imagefiledirectory.d.ts.map +1 -1
- package/dist-node/imagefiledirectory.js +23 -12
- package/dist-node/imagefiledirectory.js.map +1 -1
- package/dist-node/logging.js +7 -7
- package/dist-node/logging.js.map +1 -1
- package/dist-node/pool.js +1 -1
- package/dist-node/pool.js.map +1 -1
- package/dist-node/predictor.js +1 -1
- package/dist-node/predictor.js.map +1 -1
- package/dist-node/resample.d.ts +18 -18
- package/dist-node/resample.d.ts.map +1 -1
- package/dist-node/resample.js +12 -12
- package/dist-node/source/basesource.d.ts +7 -7
- package/dist-node/source/basesource.d.ts.map +1 -1
- package/dist-node/source/basesource.js +7 -7
- package/dist-node/source/basesource.js.map +1 -1
- package/dist-node/source/blockedsource.d.ts +10 -10
- package/dist-node/source/blockedsource.d.ts.map +1 -1
- package/dist-node/source/blockedsource.js +12 -9
- package/dist-node/source/blockedsource.js.map +1 -1
- package/dist-node/source/client/base.d.ts +8 -10
- package/dist-node/source/client/base.d.ts.map +1 -1
- package/dist-node/source/client/base.js +4 -3
- package/dist-node/source/client/base.js.map +1 -1
- package/dist-node/source/client/fetch.d.ts +2 -6
- package/dist-node/source/client/fetch.d.ts.map +1 -1
- package/dist-node/source/client/fetch.js +7 -2
- package/dist-node/source/client/fetch.js.map +1 -1
- package/dist-node/source/client/http.d.ts +4 -1
- package/dist-node/source/client/http.d.ts.map +1 -1
- package/dist-node/source/client/http.js +4 -4
- package/dist-node/source/client/http.js.map +1 -1
- package/dist-node/source/client/xhr.d.ts +4 -1
- package/dist-node/source/client/xhr.d.ts.map +1 -1
- package/dist-node/source/client/xhr.js +1 -1
- package/dist-node/source/client/xhr.js.map +1 -1
- package/dist-node/source/file.js +4 -4
- package/dist-node/source/file.js.map +1 -1
- package/dist-node/source/filereader.js +1 -1
- package/dist-node/source/filereader.js.map +1 -1
- package/dist-node/source/httputils.d.ts +14 -6
- package/dist-node/source/httputils.d.ts.map +1 -1
- package/dist-node/source/httputils.js +13 -12
- package/dist-node/source/httputils.js.map +1 -1
- package/dist-node/source/remote.d.ts +31 -22
- package/dist-node/source/remote.d.ts.map +1 -1
- package/dist-node/source/remote.js +37 -13
- package/dist-node/source/remote.js.map +1 -1
- package/dist-node/utils.d.ts +7 -1
- package/dist-node/utils.d.ts.map +1 -1
- package/dist-node/utils.js +6 -0
- package/dist-node/utils.js.map +1 -1
- package/dist-node/worker/create.js +1 -1
- package/dist-node/worker/create.js.map +1 -1
- package/package.json +3 -54
package/dist-node/geotiff.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Creates a new GeoTIFF from a remote URL.
|
|
3
3
|
* @param {string} url The URL to access the image from
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {RemoteSourceOptions} [options] Additional options to pass to the source.
|
|
5
5
|
* See {@link makeRemoteSource} for details.
|
|
6
6
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
7
7
|
* to be aborted
|
|
8
8
|
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
|
|
9
9
|
*/
|
|
10
|
-
export function fromUrl(url: string, options?:
|
|
10
|
+
export function fromUrl(url: string, options?: RemoteSourceOptions, signal?: AbortSignal): Promise<GeoTIFF>;
|
|
11
11
|
/**
|
|
12
12
|
* Creates a new GeoTIFF from a custom {@link BaseClient}.
|
|
13
13
|
* @param {BaseClient} client The client.
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {RemoteSourceOptions} [options] Additional options to pass to the source.
|
|
15
15
|
* See {@link makeRemoteSource} for details.
|
|
16
16
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
17
17
|
* to be aborted
|
|
18
18
|
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
|
|
19
19
|
*/
|
|
20
|
-
export function fromCustomClient(client: BaseClient, options?:
|
|
20
|
+
export function fromCustomClient(client: BaseClient, options?: RemoteSourceOptions, signal?: AbortSignal): Promise<GeoTIFF>;
|
|
21
21
|
/**
|
|
22
22
|
* Construct a new GeoTIFF from an
|
|
23
23
|
* [ArrayBuffer]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer}.
|
|
@@ -55,20 +55,21 @@ export function fromBlob(blob: Blob | File, signal?: AbortSignal): Promise<GeoTI
|
|
|
55
55
|
* Construct a MultiGeoTIFF from the given URLs.
|
|
56
56
|
* @param {string} mainUrl The URL for the main file.
|
|
57
57
|
* @param {string[]} overviewUrls An array of URLs for the overview images.
|
|
58
|
-
* @param {
|
|
58
|
+
* @param {RemoteSourceOptions} [options] Additional options to pass to the source.
|
|
59
59
|
* See [makeRemoteSource]{@link module:source.makeRemoteSource}
|
|
60
60
|
* for details.
|
|
61
61
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
62
62
|
* to be aborted
|
|
63
63
|
* @returns {Promise<MultiGeoTIFF>} The resulting MultiGeoTIFF file.
|
|
64
64
|
*/
|
|
65
|
-
export function fromUrls(mainUrl: string, overviewUrls?: string[], options?:
|
|
65
|
+
export function fromUrls(mainUrl: string, overviewUrls?: string[], options?: RemoteSourceOptions, signal?: AbortSignal): Promise<MultiGeoTIFF>;
|
|
66
66
|
/**
|
|
67
67
|
* Main creating function for GeoTIFF files.
|
|
68
|
-
* @param {
|
|
69
|
-
* @
|
|
68
|
+
* @param {Array} values of pixel values
|
|
69
|
+
* @param {Object} metadata
|
|
70
|
+
* @returns {ArrayBuffer}
|
|
70
71
|
*/
|
|
71
|
-
export function writeArrayBuffer(values: any, metadata: any):
|
|
72
|
+
export function writeArrayBuffer(values: any[], metadata: any): ArrayBuffer;
|
|
72
73
|
export { default as BaseDecoder } from "./compression/basedecoder.js";
|
|
73
74
|
export default GeoTIFF;
|
|
74
75
|
export type TypedArray = Uint8Array | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array;
|
|
@@ -94,6 +95,127 @@ export type TypedArrayArrayWithDimensions = TypedArray[] & Dimensions;
|
|
|
94
95
|
* `(TypedArray | TypedArray[]) & { height: number; width: number}`
|
|
95
96
|
*/
|
|
96
97
|
export type ReadRasterResult = TypedArrayWithDimensions | TypedArrayArrayWithDimensions;
|
|
98
|
+
/**
|
|
99
|
+
* Use the {@link Pool.bindParameters} method to get a decoder worker for
|
|
100
|
+
* a specific compression and its parameters.
|
|
101
|
+
*/
|
|
102
|
+
export type DecoderWorker = {
|
|
103
|
+
/**
|
|
104
|
+
* A function that takes a compressed buffer and returns a promise resolving to the decoded buffer.
|
|
105
|
+
*/
|
|
106
|
+
decode: (buffer: ArrayBuffer) => Promise<ArrayBuffer>;
|
|
107
|
+
};
|
|
108
|
+
export type ReadRastersOptions = {
|
|
109
|
+
/**
|
|
110
|
+
* the subset to read data from in pixels. Whole window if not specified.
|
|
111
|
+
*/
|
|
112
|
+
window?: number[] | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* the selection of samples to read from. Default is all samples.
|
|
115
|
+
* All samples if not specified.
|
|
116
|
+
*/
|
|
117
|
+
samples?: number[] | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* The optional decoder pool to use.
|
|
120
|
+
*/
|
|
121
|
+
pool?: Pool | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* The desired width of the output. When the width is not the
|
|
124
|
+
* same as the images, resampling will be performed.
|
|
125
|
+
*/
|
|
126
|
+
width?: number | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* The desired height of the output. When the width is not the
|
|
129
|
+
* same as the images, resampling will be performed.
|
|
130
|
+
*/
|
|
131
|
+
height?: number | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* The desired resampling method.
|
|
134
|
+
*/
|
|
135
|
+
resampleMethod?: string | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* An AbortSignal that may be signalled if the request is
|
|
138
|
+
* to be aborted
|
|
139
|
+
*/
|
|
140
|
+
signal?: AbortSignal | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* The value to use for parts of the image
|
|
143
|
+
* outside of the images extent. When multiple samples are requested and `interleave` is
|
|
144
|
+
* `false`, an array of fill values can be passed.
|
|
145
|
+
*/
|
|
146
|
+
fillValue?: number | number[] | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* whether the data shall be read
|
|
149
|
+
* in one single array or separate arrays.
|
|
150
|
+
*/
|
|
151
|
+
interleave?: boolean | undefined;
|
|
152
|
+
};
|
|
153
|
+
export type ReadRGBOptions = {
|
|
154
|
+
/**
|
|
155
|
+
* the subset to read data from in pixels. Whole window if not specified.
|
|
156
|
+
*/
|
|
157
|
+
window?: number[] | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* The optional decoder pool to use.
|
|
160
|
+
*/
|
|
161
|
+
pool?: Pool | null | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* The desired width of the output. When the width is no the
|
|
164
|
+
* same as the images, resampling will be performed.
|
|
165
|
+
*/
|
|
166
|
+
width?: number | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* The desired height of the output. When the width is no the
|
|
169
|
+
* same as the images, resampling will be performed.
|
|
170
|
+
*/
|
|
171
|
+
height?: number | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* The desired resampling method.
|
|
174
|
+
*/
|
|
175
|
+
resampleMethod?: string | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Enable reading alpha channel if present.
|
|
178
|
+
*/
|
|
179
|
+
enableAlpha?: boolean | undefined;
|
|
180
|
+
/**
|
|
181
|
+
* An AbortSignal that may be signalled if the request is
|
|
182
|
+
* to be aborted
|
|
183
|
+
*/
|
|
184
|
+
signal?: AbortSignal | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* whether the data shall be read
|
|
187
|
+
* in one single array or separate arrays.
|
|
188
|
+
*/
|
|
189
|
+
interleave?: boolean | undefined;
|
|
190
|
+
};
|
|
191
|
+
export type BlockedSourceOptions = {
|
|
192
|
+
/**
|
|
193
|
+
* Block size for a BlockedSource.
|
|
194
|
+
*/
|
|
195
|
+
blockSize?: number | null | undefined;
|
|
196
|
+
/**
|
|
197
|
+
* The number of blocks to cache.
|
|
198
|
+
*/
|
|
199
|
+
cacheSize?: number | undefined;
|
|
200
|
+
};
|
|
201
|
+
export type RemoteSourceOptions = {
|
|
202
|
+
/**
|
|
203
|
+
* Additional headers to add to each request
|
|
204
|
+
*/
|
|
205
|
+
headers?: any;
|
|
206
|
+
/**
|
|
207
|
+
* Maximum number of ranges to request in a single HTTP request. 0 means no multi-range requests.
|
|
208
|
+
*/
|
|
209
|
+
maxRanges?: number | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Whether to allow full file responses when requesting ranges
|
|
212
|
+
*/
|
|
213
|
+
allowFullFile?: boolean | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* When the Fetch API would be used, force using XMLHttpRequest instead.
|
|
216
|
+
*/
|
|
217
|
+
forceXHR?: boolean | undefined;
|
|
218
|
+
};
|
|
97
219
|
export type GeoTIFFOptions = {
|
|
98
220
|
/**
|
|
99
221
|
* whether or not decoded tiles shall be cached.
|
|
@@ -106,51 +228,37 @@ export type GeoTIFFOptions = {
|
|
|
106
228
|
*/
|
|
107
229
|
/**
|
|
108
230
|
* The abstraction for a whole GeoTIFF file.
|
|
109
|
-
* @augments GeoTIFFBase
|
|
110
231
|
*/
|
|
111
232
|
export class GeoTIFF extends GeoTIFFBase {
|
|
112
233
|
/**
|
|
113
234
|
* Parse a (Geo)TIFF file from the given source.
|
|
114
235
|
*
|
|
115
|
-
* @param {
|
|
236
|
+
* @param {BaseSource} source The source of data to parse from.
|
|
116
237
|
* @param {GeoTIFFOptions} [options] Additional options.
|
|
117
238
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
118
239
|
* to be aborted
|
|
119
240
|
*/
|
|
120
|
-
static fromSource(source:
|
|
241
|
+
static fromSource(source: BaseSource, options?: GeoTIFFOptions, signal?: AbortSignal): Promise<GeoTIFF>;
|
|
121
242
|
/**
|
|
122
243
|
* @constructor
|
|
123
|
-
* @param {
|
|
244
|
+
* @param {BaseSource} source The datasource to read from.
|
|
124
245
|
* @param {boolean} littleEndian Whether the image uses little endian.
|
|
125
246
|
* @param {boolean} bigTiff Whether the image uses bigTIFF conventions.
|
|
126
247
|
* @param {number} firstIFDOffset The numeric byte-offset from the start of the image
|
|
127
248
|
* to the first IFD.
|
|
128
249
|
* @param {GeoTIFFOptions} [options] further options.
|
|
129
250
|
*/
|
|
130
|
-
constructor(source:
|
|
131
|
-
source:
|
|
251
|
+
constructor(source: BaseSource, littleEndian: boolean, bigTiff: boolean, firstIFDOffset: number, options?: GeoTIFFOptions);
|
|
252
|
+
source: BaseSource;
|
|
132
253
|
parser: ImageFileDirectoryParser;
|
|
133
254
|
littleEndian: boolean;
|
|
134
255
|
bigTiff: boolean;
|
|
135
256
|
firstIFDOffset: number;
|
|
136
257
|
cache: boolean;
|
|
137
258
|
ifdRequests: any[];
|
|
138
|
-
ghostValues:
|
|
259
|
+
ghostValues: any;
|
|
139
260
|
getSlice(offset: any, size: any): Promise<DataSlice>;
|
|
140
261
|
requestIFD(index: any): Promise<any>;
|
|
141
|
-
/**
|
|
142
|
-
* Get the n-th internal subfile of an image. By default, the first is returned.
|
|
143
|
-
*
|
|
144
|
-
* @param {number} [index=0] the index of the image to return.
|
|
145
|
-
* @returns {Promise<GeoTIFFImage>} the image at the given index
|
|
146
|
-
*/
|
|
147
|
-
getImage(index?: number): Promise<GeoTIFFImage>;
|
|
148
|
-
/**
|
|
149
|
-
* Returns the count of the internal subfiles.
|
|
150
|
-
*
|
|
151
|
-
* @returns {Promise<number>} the number of internal subfile images
|
|
152
|
-
*/
|
|
153
|
-
getImageCount(): Promise<number>;
|
|
154
262
|
/**
|
|
155
263
|
* Get the values of the COG ghost area as a parsed map.
|
|
156
264
|
* See https://gdal.org/drivers/raster/cog.html#header-ghost-area for reference
|
|
@@ -162,7 +270,7 @@ export class GeoTIFF extends GeoTIFFBase {
|
|
|
162
270
|
* N.B. After the GeoTIFF has been completely processed it needs
|
|
163
271
|
* to be closed but only if it has been constructed from a file.
|
|
164
272
|
*/
|
|
165
|
-
close():
|
|
273
|
+
close(): false | Promise<void>;
|
|
166
274
|
}
|
|
167
275
|
import { BaseClient } from './source/client/base.js';
|
|
168
276
|
/**
|
|
@@ -183,19 +291,6 @@ export class MultiGeoTIFF extends GeoTIFFBase {
|
|
|
183
291
|
fileDirectoriesPerFileParsing: any;
|
|
184
292
|
imageCount: number | null;
|
|
185
293
|
parseFileDirectoriesPerFile(): Promise<import("./imagefiledirectory.js").ImageFileDirectory[]>;
|
|
186
|
-
/**
|
|
187
|
-
* Get the n-th internal subfile of an image. By default, the first is returned.
|
|
188
|
-
*
|
|
189
|
-
* @param {number} [index=0] the index of the image to return.
|
|
190
|
-
* @returns {Promise<GeoTIFFImage>} the image at the given index
|
|
191
|
-
*/
|
|
192
|
-
getImage(index?: number): Promise<GeoTIFFImage>;
|
|
193
|
-
/**
|
|
194
|
-
* Returns the count of the internal subfiles.
|
|
195
|
-
*
|
|
196
|
-
* @returns {Promise<number>} the number of internal subfile images
|
|
197
|
-
*/
|
|
198
|
-
getImageCount(): Promise<number>;
|
|
199
294
|
imageCounts: number[] | undefined;
|
|
200
295
|
}
|
|
201
296
|
import * as globals from './globals.js';
|
|
@@ -208,6 +303,22 @@ import Pool from './pool.js';
|
|
|
208
303
|
import GeoTIFFImage from './geotiffimage.js';
|
|
209
304
|
import { BaseResponse } from './source/client/base.js';
|
|
210
305
|
declare class GeoTIFFBase {
|
|
306
|
+
/**
|
|
307
|
+
* @param {number} [_index=0] the index of the image to return.
|
|
308
|
+
* @returns {Promise<GeoTIFFImage>} the image at the given index
|
|
309
|
+
*/
|
|
310
|
+
getImage(_index?: number): Promise<GeoTIFFImage>;
|
|
311
|
+
/**
|
|
312
|
+
* @returns {Promise<number>} the number of internal subfile images
|
|
313
|
+
*/
|
|
314
|
+
getImageCount(): Promise<number>;
|
|
315
|
+
/**
|
|
316
|
+
* @typedef {Object} ReadRastersWindowOptions
|
|
317
|
+
* @property {number} [resX] desired Y resolution (world units per pixel)
|
|
318
|
+
* @property {number} [resY] desired X resolution (world units per pixel)
|
|
319
|
+
* @property {Array<number>} [bbox] the subset to read data from in
|
|
320
|
+
* geographical coordinates. Whole image if not specified.
|
|
321
|
+
*/
|
|
211
322
|
/**
|
|
212
323
|
* (experimental) Reads raster data from the best fitting image. This function uses
|
|
213
324
|
* the image with the lowest resolution that is still a higher resolution than the
|
|
@@ -217,11 +328,26 @@ declare class GeoTIFFBase {
|
|
|
217
328
|
* Then, the [readRasters]{@link GeoTIFFImage#readRasters} method of the selected
|
|
218
329
|
* image is called and the result returned.
|
|
219
330
|
* @see GeoTIFFImage.readRasters
|
|
220
|
-
* @param {
|
|
331
|
+
* @param {ReadRastersOptions & ReadRastersWindowOptions} options optional parameters
|
|
221
332
|
* @returns {Promise<ReadRasterResult>} the decoded array(s), with `height` and `width`, as a promise
|
|
222
333
|
*/
|
|
223
|
-
readRasters(options?:
|
|
334
|
+
readRasters(options?: ReadRastersOptions & {
|
|
335
|
+
/**
|
|
336
|
+
* desired Y resolution (world units per pixel)
|
|
337
|
+
*/
|
|
338
|
+
resX?: number | undefined;
|
|
339
|
+
/**
|
|
340
|
+
* desired X resolution (world units per pixel)
|
|
341
|
+
*/
|
|
342
|
+
resY?: number | undefined;
|
|
343
|
+
/**
|
|
344
|
+
* the subset to read data from in
|
|
345
|
+
* geographical coordinates. Whole image if not specified.
|
|
346
|
+
*/
|
|
347
|
+
bbox?: number[] | undefined;
|
|
348
|
+
}): Promise<ReadRasterResult>;
|
|
224
349
|
}
|
|
350
|
+
import type { BaseSource } from './source/basesource.js';
|
|
225
351
|
import { ImageFileDirectoryParser } from './imagefiledirectory.js';
|
|
226
352
|
import DataSlice from './dataslice.js';
|
|
227
353
|
export { globals, registerTag, rgb, getDecoder, addDecoder, setLogger, Pool, GeoTIFFImage, BaseClient, BaseResponse };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geotiff.d.ts","sourceRoot":"","sources":["../dist-module/geotiff.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geotiff.d.ts","sourceRoot":"","sources":["../dist-module/geotiff.js"],"names":[],"mappings":"AA6kBA;;;;;;;;GAQG;AACH,6BAPW,MAAM,YACN,mBAAmB,WAEnB,WAAW,GAET,OAAO,CAAC,OAAO,CAAC,CAI5B;AACD;;;;;;;;GAQG;AACH,yCAPW,UAAU,YACV,mBAAmB,WAEnB,WAAW,GAET,OAAO,CAAC,OAAO,CAAC,CAI5B;AACD;;;;;;;GAOG;AACH,6CALW,WAAW,WACX,WAAW,GAET,OAAO,CAAC,OAAO,CAAC,CAI5B;AACD;;;;;;;;;;;GAWG;AACH,+BALW,MAAM,WACN,WAAW,GAET,OAAO,CAAC,OAAO,CAAC,CAI5B;AACD;;;;;;;;;GASG;AACH,+BALW,IAAI,GAAC,IAAI,WACT,WAAW,GAET,OAAO,CAAC,OAAO,CAAC,CAI5B;AACD;;;;;;;;;;GAUG;AACH,kCATW,MAAM,iBACN,MAAM,EAAE,YACR,mBAAmB,WAGnB,WAAW,GAET,OAAO,CAAC,YAAY,CAAC,CAMjC;AACD;;;;;GAKG;AACH,gEAFa,WAAW,CAIvB;;;yBA3oBY,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY;yBAI1G;IAAE,MAAM,EAAC,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;;;;;;uCAMhC,UAAU,GAAG,UAAU;;;;;;4CAMvB,UAAU,EAAE,GAAG,UAAU;;;;;;+BAMzB,wBAAwB,GAAG,6BAA6B;;;;;;;;;YAOvD,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6Q3D;;;GAGG;AACH;;GAEG;AACH;IAqII;;;;;;;OAOG;IACH,0BALW,UAAU,YACV,cAAc,WACd,WAAW,oBAoCrB;IA7KD;;;;;;;;OAQG;IACH,oBAPW,UAAU,gBACV,OAAO,WACP,OAAO,kBACP,MAAM,YAEN,cAAc,EAYxB;IARG,mBAAoB;IACpB,iCAAgF;IAChF,sBAAgC;IAChC,iBAAsB;IACtB,uBAAoC;IACpC,eAAmC;IACnC,mBAAqB;IACrB,iBAAuB;IAE3B,qDAMC;IACD,qCAqCC;IAmCD;;;;OAIG;IACH,kBAFa,OAAO,KAAQ,CA6B3B;IA2CD;;;;OAIG;IACH,+BAKC;CACJ;2BA3fwC,yBAAyB;AA8flE;;;GAGG;AACH;IACI;;;;OAIG;IACH,sBAHW,OAAO,iBACP,OAAO,EAAE,EAUnB;IANG,kBAAwB;IACxB,yBAAkC;IAClC,sBAAkD;IAClD,sFAAkC;IAClC,mCAAyC;IACzC,0BAAsB;IAE1B,+FAKC;IAwCG,kCAA8C;CAIrD;yBA9jBwB,cAAc;4BAFmB,cAAc;qBAGnD,UAAU;2BACQ,wBAAwB;2BAAxB,wBAAwB;0BACrC,cAAc;iBAZvB,WAAW;yBAHH,mBAAmB;6BAQH,yBAAyB;AAwMlE;IACI;;;OAGG;IACH,kBAHW,MAAM,GACJ,OAAO,CAAC,YAAY,CAAC,CAIjC;IACD;;OAEG;IACH,iBAFa,OAAO,CAAC,MAAM,CAAC,CAI3B;IACD;;;;;;OAMG;IACH;;;;;;;;;;;OAWG;IACH,sBAHW,kBAAkB;;;;;;;;;;;;;;KAA2B,GAC3C,OAAO,CAAC,gBAAgB,CAAC,CAiFrC;CACJ;gCAjT+B,wBAAwB;yCAPf,yBAAyB;sBAP5C,gBAAgB"}
|
package/dist-node/geotiff.js
CHANGED
|
@@ -98,7 +98,77 @@ Object.defineProperty(exports, "BaseDecoder", { enumerable: true, get: function
|
|
|
98
98
|
* `(TypedArray | TypedArray[]) & { height: number; width: number}`
|
|
99
99
|
* @typedef {TypedArrayWithDimensions | TypedArrayArrayWithDimensions} ReadRasterResult
|
|
100
100
|
*/
|
|
101
|
+
/**
|
|
102
|
+
* @typedef {Object} DecoderWorker
|
|
103
|
+
* Use the {@link Pool.bindParameters} method to get a decoder worker for
|
|
104
|
+
* a specific compression and its parameters.
|
|
105
|
+
*
|
|
106
|
+
* @property {(buffer: ArrayBuffer) => Promise<ArrayBuffer>} decode
|
|
107
|
+
* A function that takes a compressed buffer and returns a promise resolving to the decoded buffer.
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* @typedef {Object} ReadRastersOptions
|
|
111
|
+
* @property {Array<number>} [window] the subset to read data from in pixels. Whole window if not specified.
|
|
112
|
+
* @property {Array<number>} [samples] the selection of samples to read from. Default is all samples.
|
|
113
|
+
* All samples if not specified.
|
|
114
|
+
* @property {Pool|null} [pool=null] The optional decoder pool to use.
|
|
115
|
+
* @property {number} [width] The desired width of the output. When the width is not the
|
|
116
|
+
* same as the images, resampling will be performed.
|
|
117
|
+
* @property {number} [height] The desired height of the output. When the width is not the
|
|
118
|
+
* same as the images, resampling will be performed.
|
|
119
|
+
* @property {string} [resampleMethod='nearest'] The desired resampling method.
|
|
120
|
+
* @property {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
121
|
+
* to be aborted
|
|
122
|
+
* @property {number|number[]} [fillValue] The value to use for parts of the image
|
|
123
|
+
* outside of the images extent. When multiple samples are requested and `interleave` is
|
|
124
|
+
* `false`, an array of fill values can be passed.
|
|
125
|
+
* @property {boolean|true|false} [interleave] whether the data shall be read
|
|
126
|
+
* in one single array or separate arrays.
|
|
127
|
+
*/
|
|
128
|
+
/**
|
|
129
|
+
* @typedef {Object} ReadRGBOptions
|
|
130
|
+
* @property {Array<number>} [window] the subset to read data from in pixels. Whole window if not specified.
|
|
131
|
+
* @property {Pool|null} [pool=null] The optional decoder pool to use.
|
|
132
|
+
* @property {number} [width] The desired width of the output. When the width is no the
|
|
133
|
+
* same as the images, resampling will be performed.
|
|
134
|
+
* @property {number} [height] The desired height of the output. When the width is no the
|
|
135
|
+
* same as the images, resampling will be performed.
|
|
136
|
+
* @property {string} [resampleMethod='nearest'] The desired resampling method.
|
|
137
|
+
* @property {boolean} [enableAlpha=false] Enable reading alpha channel if present.
|
|
138
|
+
* @property {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
139
|
+
* to be aborted
|
|
140
|
+
* @property {boolean|true|false} [interleave] whether the data shall be read
|
|
141
|
+
* in one single array or separate arrays.
|
|
142
|
+
*/
|
|
143
|
+
/**
|
|
144
|
+
* @typedef {Object} BlockedSourceOptions
|
|
145
|
+
* @property {number|null} [blockSize=null] Block size for a BlockedSource.
|
|
146
|
+
* @property {number} [cacheSize=100] The number of blocks to cache.
|
|
147
|
+
*/
|
|
148
|
+
/**
|
|
149
|
+
* @typedef {Object} RemoteSourceOptions
|
|
150
|
+
* @property {Object} [headers={}] Additional headers to add to each request
|
|
151
|
+
* @property {number} [maxRanges=0] Maximum number of ranges to request in a single HTTP request. 0 means no multi-range requests.
|
|
152
|
+
* @property {boolean} [allowFullFile=false] Whether to allow full file responses when requesting ranges
|
|
153
|
+
* @property {boolean} [forceXHR=false] When the Fetch API would be used, force using XMLHttpRequest instead.
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* @overload
|
|
157
|
+
* @param {DataSlice} dataSlice
|
|
158
|
+
* @param {0x0002} fieldType
|
|
159
|
+
* @param {number} count
|
|
160
|
+
* @param {number} offset
|
|
161
|
+
* @returns {string}
|
|
162
|
+
*/
|
|
163
|
+
/**
|
|
164
|
+
* @param {DataSlice} dataSlice
|
|
165
|
+
* @param {import('./globals.js').FieldType} fieldType
|
|
166
|
+
* @param {number} count
|
|
167
|
+
* @param {number} offset
|
|
168
|
+
* @returns {TypedArray|Array<number>|string}
|
|
169
|
+
*/
|
|
101
170
|
function getValues(dataSlice, fieldType, count, offset) {
|
|
171
|
+
/** @type {TypedArray|Array|null} */
|
|
102
172
|
let values = null;
|
|
103
173
|
let readMethod = null;
|
|
104
174
|
const fieldTypeLength = (0, globals_js_1.getFieldTypeSize)(fieldType);
|
|
@@ -156,7 +226,10 @@ function getValues(dataSlice, fieldType, count, offset) {
|
|
|
156
226
|
readMethod = dataSlice.readFloat64;
|
|
157
227
|
break;
|
|
158
228
|
default:
|
|
159
|
-
|
|
229
|
+
// will throw below
|
|
230
|
+
}
|
|
231
|
+
if (values === null || readMethod === null) {
|
|
232
|
+
throw new RangeError(`Invalid field type: ${fieldType}`);
|
|
160
233
|
}
|
|
161
234
|
// normal fields
|
|
162
235
|
if (!(fieldType === globals_js_1.fieldTypes.RATIONAL || fieldType === globals_js_1.fieldTypes.SRATIONAL)) {
|
|
@@ -171,7 +244,7 @@ function getValues(dataSlice, fieldType, count, offset) {
|
|
|
171
244
|
}
|
|
172
245
|
}
|
|
173
246
|
if (fieldType === globals_js_1.fieldTypes.ASCII) {
|
|
174
|
-
return new TextDecoder('utf-8').decode(values);
|
|
247
|
+
return new TextDecoder('utf-8').decode(/** @type {Uint8Array} */ (values));
|
|
175
248
|
}
|
|
176
249
|
return values;
|
|
177
250
|
}
|
|
@@ -186,6 +259,26 @@ class GeoTIFFImageIndexError extends Error {
|
|
|
186
259
|
}
|
|
187
260
|
}
|
|
188
261
|
class GeoTIFFBase {
|
|
262
|
+
/**
|
|
263
|
+
* @param {number} [_index=0] the index of the image to return.
|
|
264
|
+
* @returns {Promise<GeoTIFFImage>} the image at the given index
|
|
265
|
+
*/
|
|
266
|
+
async getImage(_index = 0) {
|
|
267
|
+
throw new Error('Not implemented');
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* @returns {Promise<number>} the number of internal subfile images
|
|
271
|
+
*/
|
|
272
|
+
async getImageCount() {
|
|
273
|
+
throw new Error('Not implemented');
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* @typedef {Object} ReadRastersWindowOptions
|
|
277
|
+
* @property {number} [resX] desired Y resolution (world units per pixel)
|
|
278
|
+
* @property {number} [resY] desired X resolution (world units per pixel)
|
|
279
|
+
* @property {Array<number>} [bbox] the subset to read data from in
|
|
280
|
+
* geographical coordinates. Whole image if not specified.
|
|
281
|
+
*/
|
|
189
282
|
/**
|
|
190
283
|
* (experimental) Reads raster data from the best fitting image. This function uses
|
|
191
284
|
* the image with the lowest resolution that is still a higher resolution than the
|
|
@@ -195,7 +288,7 @@ class GeoTIFFBase {
|
|
|
195
288
|
* Then, the [readRasters]{@link GeoTIFFImage#readRasters} method of the selected
|
|
196
289
|
* image is called and the result returned.
|
|
197
290
|
* @see GeoTIFFImage.readRasters
|
|
198
|
-
* @param {
|
|
291
|
+
* @param {ReadRastersOptions & ReadRastersWindowOptions} options optional parameters
|
|
199
292
|
* @returns {Promise<ReadRasterResult>} the decoded array(s), with `height` and `width`, as a promise
|
|
200
293
|
*/
|
|
201
294
|
async readRasters(options = {}) {
|
|
@@ -285,12 +378,11 @@ class GeoTIFFBase {
|
|
|
285
378
|
*/
|
|
286
379
|
/**
|
|
287
380
|
* The abstraction for a whole GeoTIFF file.
|
|
288
|
-
* @augments GeoTIFFBase
|
|
289
381
|
*/
|
|
290
382
|
class GeoTIFF extends GeoTIFFBase {
|
|
291
383
|
/**
|
|
292
384
|
* @constructor
|
|
293
|
-
* @param {
|
|
385
|
+
* @param {BaseSource} source The datasource to read from.
|
|
294
386
|
* @param {boolean} littleEndian Whether the image uses little endian.
|
|
295
387
|
* @param {boolean} bigTiff Whether the image uses bigTIFF conventions.
|
|
296
388
|
* @param {number} firstIFDOffset The numeric byte-offset from the start of the image
|
|
@@ -360,7 +452,7 @@ class GeoTIFF extends GeoTIFFBase {
|
|
|
360
452
|
* @returns {Promise<GeoTIFFImage>} the image at the given index
|
|
361
453
|
*/
|
|
362
454
|
async getImage(index = 0) {
|
|
363
|
-
return new geotiffimage_js_1.default(await this.requestIFD(index), this.
|
|
455
|
+
return new geotiffimage_js_1.default(await this.requestIFD(index), this.littleEndian, this.cache, this.source);
|
|
364
456
|
}
|
|
365
457
|
/**
|
|
366
458
|
* Returns the count of the internal subfiles.
|
|
@@ -408,6 +500,7 @@ class GeoTIFF extends GeoTIFFBase {
|
|
|
408
500
|
slice = await this.getSlice(offset, metadataSize);
|
|
409
501
|
}
|
|
410
502
|
const fullString = getValues(slice, globals_js_1.fieldTypes.ASCII, metadataSize, offset);
|
|
503
|
+
/** @type {Object} */
|
|
411
504
|
this.ghostValues = {};
|
|
412
505
|
fullString
|
|
413
506
|
.split('\n')
|
|
@@ -422,7 +515,7 @@ class GeoTIFF extends GeoTIFFBase {
|
|
|
422
515
|
/**
|
|
423
516
|
* Parse a (Geo)TIFF file from the given source.
|
|
424
517
|
*
|
|
425
|
-
* @param {
|
|
518
|
+
* @param {BaseSource} source The source of data to parse from.
|
|
426
519
|
* @param {GeoTIFFOptions} [options] Additional options.
|
|
427
520
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
428
521
|
* to be aborted
|
|
@@ -507,7 +600,11 @@ class MultiGeoTIFF extends GeoTIFFBase {
|
|
|
507
600
|
* @returns {Promise<GeoTIFFImage>} the image at the given index
|
|
508
601
|
*/
|
|
509
602
|
async getImage(index = 0) {
|
|
603
|
+
// Initialize this.imageCounts if not yet done
|
|
510
604
|
await this.getImageCount();
|
|
605
|
+
if (!this.imageCounts) {
|
|
606
|
+
throw new Error('Image counts not available');
|
|
607
|
+
}
|
|
511
608
|
await this.parseFileDirectoriesPerFile();
|
|
512
609
|
let visited = 0;
|
|
513
610
|
let relativeIndex = 0;
|
|
@@ -515,7 +612,7 @@ class MultiGeoTIFF extends GeoTIFFBase {
|
|
|
515
612
|
const imageFile = this.imageFiles[i];
|
|
516
613
|
for (let ii = 0; ii < this.imageCounts[i]; ii++) {
|
|
517
614
|
if (index === visited) {
|
|
518
|
-
return new geotiffimage_js_1.default(await imageFile.requestIFD(relativeIndex), imageFile.
|
|
615
|
+
return new geotiffimage_js_1.default(await imageFile.requestIFD(relativeIndex), imageFile.littleEndian, imageFile.cache, imageFile.source);
|
|
519
616
|
}
|
|
520
617
|
visited++;
|
|
521
618
|
relativeIndex++;
|
|
@@ -544,26 +641,26 @@ exports.MultiGeoTIFF = MultiGeoTIFF;
|
|
|
544
641
|
/**
|
|
545
642
|
* Creates a new GeoTIFF from a remote URL.
|
|
546
643
|
* @param {string} url The URL to access the image from
|
|
547
|
-
* @param {
|
|
644
|
+
* @param {RemoteSourceOptions} [options] Additional options to pass to the source.
|
|
548
645
|
* See {@link makeRemoteSource} for details.
|
|
549
646
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
550
647
|
* to be aborted
|
|
551
648
|
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
|
|
552
649
|
*/
|
|
553
650
|
async function fromUrl(url, options = {}, signal) {
|
|
554
|
-
return GeoTIFF.fromSource((0, remote_js_1.makeRemoteSource)(url, options), signal);
|
|
651
|
+
return GeoTIFF.fromSource((0, remote_js_1.makeRemoteSource)(url, options), undefined, signal);
|
|
555
652
|
}
|
|
556
653
|
/**
|
|
557
654
|
* Creates a new GeoTIFF from a custom {@link BaseClient}.
|
|
558
655
|
* @param {BaseClient} client The client.
|
|
559
|
-
* @param {
|
|
656
|
+
* @param {RemoteSourceOptions} [options] Additional options to pass to the source.
|
|
560
657
|
* See {@link makeRemoteSource} for details.
|
|
561
658
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
562
659
|
* to be aborted
|
|
563
660
|
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
|
|
564
661
|
*/
|
|
565
662
|
async function fromCustomClient(client, options = {}, signal) {
|
|
566
|
-
return GeoTIFF.fromSource((0, remote_js_1.makeCustomSource)(client, options), signal);
|
|
663
|
+
return GeoTIFF.fromSource((0, remote_js_1.makeCustomSource)(client, options), undefined, signal);
|
|
567
664
|
}
|
|
568
665
|
/**
|
|
569
666
|
* Construct a new GeoTIFF from an
|
|
@@ -574,7 +671,7 @@ async function fromCustomClient(client, options = {}, signal) {
|
|
|
574
671
|
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
|
|
575
672
|
*/
|
|
576
673
|
async function fromArrayBuffer(arrayBuffer, signal) {
|
|
577
|
-
return GeoTIFF.fromSource((0, arraybuffer_js_1.makeBufferSource)(arrayBuffer), signal);
|
|
674
|
+
return GeoTIFF.fromSource((0, arraybuffer_js_1.makeBufferSource)(arrayBuffer), undefined, signal);
|
|
578
675
|
}
|
|
579
676
|
/**
|
|
580
677
|
* Construct a GeoTIFF from a local file path. This uses the node
|
|
@@ -589,7 +686,7 @@ async function fromArrayBuffer(arrayBuffer, signal) {
|
|
|
589
686
|
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
|
|
590
687
|
*/
|
|
591
688
|
async function fromFile(path, signal) {
|
|
592
|
-
return GeoTIFF.fromSource((0, file_js_1.makeFileSource)(path), signal);
|
|
689
|
+
return GeoTIFF.fromSource((0, file_js_1.makeFileSource)(path), undefined, signal);
|
|
593
690
|
}
|
|
594
691
|
/**
|
|
595
692
|
* Construct a GeoTIFF from an HTML
|
|
@@ -602,13 +699,13 @@ async function fromFile(path, signal) {
|
|
|
602
699
|
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
|
|
603
700
|
*/
|
|
604
701
|
async function fromBlob(blob, signal) {
|
|
605
|
-
return GeoTIFF.fromSource((0, filereader_js_1.makeFileReaderSource)(blob), signal);
|
|
702
|
+
return GeoTIFF.fromSource((0, filereader_js_1.makeFileReaderSource)(blob), undefined, signal);
|
|
606
703
|
}
|
|
607
704
|
/**
|
|
608
705
|
* Construct a MultiGeoTIFF from the given URLs.
|
|
609
706
|
* @param {string} mainUrl The URL for the main file.
|
|
610
707
|
* @param {string[]} overviewUrls An array of URLs for the overview images.
|
|
611
|
-
* @param {
|
|
708
|
+
* @param {RemoteSourceOptions} [options] Additional options to pass to the source.
|
|
612
709
|
* See [makeRemoteSource]{@link module:source.makeRemoteSource}
|
|
613
710
|
* for details.
|
|
614
711
|
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
|
|
@@ -616,14 +713,15 @@ async function fromBlob(blob, signal) {
|
|
|
616
713
|
* @returns {Promise<MultiGeoTIFF>} The resulting MultiGeoTIFF file.
|
|
617
714
|
*/
|
|
618
715
|
async function fromUrls(mainUrl, overviewUrls = [], options = {}, signal) {
|
|
619
|
-
const mainFile = await GeoTIFF.fromSource((0, remote_js_1.makeRemoteSource)(mainUrl, options), signal);
|
|
620
|
-
const overviewFiles = await Promise.all(overviewUrls.map((url) => GeoTIFF.fromSource((0, remote_js_1.makeRemoteSource)(url, options))));
|
|
716
|
+
const mainFile = await GeoTIFF.fromSource((0, remote_js_1.makeRemoteSource)(mainUrl, options), undefined, signal);
|
|
717
|
+
const overviewFiles = await Promise.all(overviewUrls.map((url) => GeoTIFF.fromSource((0, remote_js_1.makeRemoteSource)(url, options), undefined, signal)));
|
|
621
718
|
return new MultiGeoTIFF(mainFile, overviewFiles);
|
|
622
719
|
}
|
|
623
720
|
/**
|
|
624
721
|
* Main creating function for GeoTIFF files.
|
|
625
|
-
* @param {
|
|
626
|
-
* @
|
|
722
|
+
* @param {Array} values of pixel values
|
|
723
|
+
* @param {Object} metadata
|
|
724
|
+
* @returns {ArrayBuffer}
|
|
627
725
|
*/
|
|
628
726
|
function writeArrayBuffer(values, metadata) {
|
|
629
727
|
return (0, geotiffwriter_js_1.writeGeotiff)(values, metadata);
|