ol-stac 1.2.0 → 1.4.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.
@@ -1,358 +0,0 @@
1
- export default GeoTIFFSource;
2
- export type SourceInfo = {
3
- /**
4
- * URL for the source GeoTIFF.
5
- */
6
- url?: string | undefined;
7
- /**
8
- * List of any overview URLs, only applies if the url parameter is given.
9
- */
10
- overviews?: string[] | undefined;
11
- /**
12
- * Blob containing the source GeoTIFF. `blob` and `url` are mutually exclusive.
13
- */
14
- blob?: Blob | undefined;
15
- /**
16
- * The minimum source data value. Rendered values are scaled from 0 to 1 based on
17
- * the configured min and max. If not provided and raster statistics are available, those will be used instead.
18
- * If neither are available, the minimum for the data type will be used. To disable this behavior, set
19
- * the `normalize` option to `false` in the constructor.
20
- */
21
- min?: number | undefined;
22
- /**
23
- * The maximum source data value. Rendered values are scaled from 0 to 1 based on
24
- * the configured min and max. If not provided and raster statistics are available, those will be used instead.
25
- * If neither are available, the maximum for the data type will be used. To disable this behavior, set
26
- * the `normalize` option to `false` in the constructor.
27
- */
28
- max?: number | undefined;
29
- /**
30
- * Values to discard (overriding any nodata values in the metadata).
31
- * When provided, an additional alpha band will be added to the data. Often the GeoTIFF metadata
32
- * will include information about nodata values, so you should only need to set this property if
33
- * you find that it is not already extracted from the metadata.
34
- */
35
- nodata?: number | undefined;
36
- /**
37
- * Band numbers to be read from (where the first band is `1`). If not provided, all bands will
38
- * be read. For example, if a GeoTIFF has blue (1), green (2), red (3), and near-infrared (4) bands, and you only need the
39
- * near-infrared band, configure `bands: [4]`.
40
- */
41
- bands?: number[] | undefined;
42
- };
43
- export type GeoKeys = {
44
- /**
45
- * Model type.
46
- */
47
- GTModelTypeGeoKey: number;
48
- /**
49
- * Raster type.
50
- */
51
- GTRasterTypeGeoKey: number;
52
- /**
53
- * Angular units.
54
- */
55
- GeogAngularUnitsGeoKey: number;
56
- /**
57
- * Inverse flattening.
58
- */
59
- GeogInvFlatteningGeoKey: number;
60
- /**
61
- * Semi-major axis.
62
- */
63
- GeogSemiMajorAxisGeoKey: number;
64
- /**
65
- * Geographic coordinate system code.
66
- */
67
- GeographicTypeGeoKey: number;
68
- /**
69
- * Projected linear unit code.
70
- */
71
- ProjLinearUnitsGeoKey: number;
72
- /**
73
- * Projected coordinate system code.
74
- */
75
- ProjectedCSTypeGeoKey: number;
76
- };
77
- export type GeoTIFF = import("geotiff").GeoTIFF;
78
- export type MultiGeoTIFF = import("geotiff").MultiGeoTIFF;
79
- export type GDALMetadata = {
80
- /**
81
- * The minimum value (as a string).
82
- */
83
- STATISTICS_MINIMUM: string;
84
- /**
85
- * The maximum value (as a string).
86
- */
87
- STATISTICS_MAXIMUM: string;
88
- };
89
- export type GeoTIFFImage = import("geotiff").GeoTIFFImage;
90
- export type GeoTIFFSourceOptions = {
91
- /**
92
- * Whether to force the usage of the browsers XMLHttpRequest API.
93
- */
94
- forceXHR?: boolean | undefined;
95
- /**
96
- * additional key-value pairs of headers to be passed with each request. Key is the header name, value the header value.
97
- */
98
- headers?: {
99
- [x: string]: string;
100
- } | undefined;
101
- /**
102
- * How credentials shall be handled. See
103
- * https://developer.mozilla.org/en-US/docs/Web/API/fetch for reference and possible values
104
- */
105
- credentials?: string | undefined;
106
- /**
107
- * The maximum amount of ranges to request in a single multi-range request.
108
- * By default only a single range is used.
109
- */
110
- maxRanges?: number | undefined;
111
- /**
112
- * Whether or not a full file is accepted when only a portion is
113
- * requested. Only use this when you know the source image to be small enough to fit in memory.
114
- */
115
- allowFullFile?: boolean | undefined;
116
- /**
117
- * The block size to use.
118
- */
119
- blockSize?: number | undefined;
120
- /**
121
- * The number of blocks that shall be held in a LRU cache.
122
- */
123
- cacheSize?: number | undefined;
124
- };
125
- export type Options = {
126
- /**
127
- * List of information about GeoTIFF sources.
128
- * Multiple sources can be combined when their resolution sets are equal after applying a scale.
129
- * The list of sources defines a mapping between input bands as they are read from each GeoTIFF and
130
- * the output bands that are provided by data tiles. To control which bands to read from each GeoTIFF,
131
- * use the {@link import ("./GeoTIFF.js").SourceInfo bands} property. If, for example, you specify two
132
- * sources, one with 3 bands and {@link import ("./GeoTIFF.js").SourceInfo nodata} configured, and
133
- * another with 1 band, the resulting data tiles will have 5 bands: 3 from the first source, 1 alpha
134
- * band from the first source, and 1 band from the second source.
135
- */
136
- sources: Array<SourceInfo>;
137
- /**
138
- * Additional options to be passed to [geotiff.js](https://geotiffjs.github.io/geotiff.js/module-geotiff.html)'s `fromUrl` or `fromUrls` methods.
139
- */
140
- sourceOptions?: GeoTIFFSourceOptions | undefined;
141
- /**
142
- * By default, bands from the sources are read as-is. When
143
- * reading GeoTIFFs with the purpose of displaying them as RGB images, setting this to `true` will
144
- * convert other color spaces (YCbCr, CMYK) to RGB. Setting the option to `'auto'` will make it so CMYK, YCbCr,
145
- * CIELab, and ICCLab images will automatically be converted to RGB.
146
- */
147
- convertToRGB?: boolean | "auto" | undefined;
148
- /**
149
- * By default, the source data is normalized to values between
150
- * 0 and 1 with scaling factors based on the raster statistics or `min` and `max` properties of each source.
151
- * If instead you want to work with the raw values in a style expression, set this to `false`. Setting this option
152
- * to `false` will make it so any `min` and `max` properties on sources are ignored.
153
- */
154
- normalize?: boolean | undefined;
155
- /**
156
- * Source projection. If not provided, the GeoTIFF metadata
157
- * will be read for projection information.
158
- */
159
- projection?: import("ol/proj.js").ProjectionLike;
160
- /**
161
- * Whether to attempt to load missing projection definitions.
162
- * Uses the configured EPSG lookup function, which can be set with {@link module :ol/proj/proj4.setEPSGLookup}.
163
- */
164
- loadMissingProjection?: boolean | undefined;
165
- /**
166
- * Duration of the opacity transition for rendering.
167
- * To disable the opacity transition, pass `transition: 0`.
168
- */
169
- transition?: number | undefined;
170
- /**
171
- * Render tiles beyond the tile grid extent.
172
- */
173
- wrapX?: boolean | undefined;
174
- /**
175
- * Use interpolated values when resampling. By default,
176
- * the linear interpolation is used to resample the data. If false, nearest neighbor is used.
177
- */
178
- interpolate?: boolean | undefined;
179
- };
180
- /**
181
- * @typedef {Object} GeoTIFFSourceOptions
182
- * @property {boolean} [forceXHR=false] Whether to force the usage of the browsers XMLHttpRequest API.
183
- * @property {Object<string, string>} [headers] additional key-value pairs of headers to be passed with each request. Key is the header name, value the header value.
184
- * @property {string} [credentials] How credentials shall be handled. See
185
- * https://developer.mozilla.org/en-US/docs/Web/API/fetch for reference and possible values
186
- * @property {number} [maxRanges] The maximum amount of ranges to request in a single multi-range request.
187
- * By default only a single range is used.
188
- * @property {boolean} [allowFullFile=false] Whether or not a full file is accepted when only a portion is
189
- * requested. Only use this when you know the source image to be small enough to fit in memory.
190
- * @property {number} [blockSize=65536] The block size to use.
191
- * @property {number} [cacheSize=100] The number of blocks that shall be held in a LRU cache.
192
- */
193
- /**
194
- * @typedef {Object} Options
195
- * @property {Array<SourceInfo>} sources List of information about GeoTIFF sources.
196
- * Multiple sources can be combined when their resolution sets are equal after applying a scale.
197
- * The list of sources defines a mapping between input bands as they are read from each GeoTIFF and
198
- * the output bands that are provided by data tiles. To control which bands to read from each GeoTIFF,
199
- * use the {@link import("./GeoTIFF.js").SourceInfo bands} property. If, for example, you specify two
200
- * sources, one with 3 bands and {@link import("./GeoTIFF.js").SourceInfo nodata} configured, and
201
- * another with 1 band, the resulting data tiles will have 5 bands: 3 from the first source, 1 alpha
202
- * band from the first source, and 1 band from the second source.
203
- * @property {GeoTIFFSourceOptions} [sourceOptions] Additional options to be passed to [geotiff.js](https://geotiffjs.github.io/geotiff.js/module-geotiff.html)'s `fromUrl` or `fromUrls` methods.
204
- * @property {true|false|'auto'} [convertToRGB=false] By default, bands from the sources are read as-is. When
205
- * reading GeoTIFFs with the purpose of displaying them as RGB images, setting this to `true` will
206
- * convert other color spaces (YCbCr, CMYK) to RGB. Setting the option to `'auto'` will make it so CMYK, YCbCr,
207
- * CIELab, and ICCLab images will automatically be converted to RGB.
208
- * @property {boolean} [normalize=true] By default, the source data is normalized to values between
209
- * 0 and 1 with scaling factors based on the raster statistics or `min` and `max` properties of each source.
210
- * If instead you want to work with the raw values in a style expression, set this to `false`. Setting this option
211
- * to `false` will make it so any `min` and `max` properties on sources are ignored.
212
- * @property {import("ol/proj.js").ProjectionLike} [projection] Source projection. If not provided, the GeoTIFF metadata
213
- * will be read for projection information.
214
- * @property {boolean} [loadMissingProjection=false] Whether to attempt to load missing projection definitions.
215
- * Uses the configured EPSG lookup function, which can be set with {@link module:ol/proj/proj4.setEPSGLookup}.
216
- * @property {number} [transition=250] Duration of the opacity transition for rendering.
217
- * To disable the opacity transition, pass `transition: 0`.
218
- * @property {boolean} [wrapX=false] Render tiles beyond the tile grid extent.
219
- * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default,
220
- * the linear interpolation is used to resample the data. If false, nearest neighbor is used.
221
- */
222
- /**
223
- * @classdesc
224
- * A source for working with GeoTIFF data.
225
- * **Note for users of the full build**: The `GeoTIFF` source requires the
226
- * [geotiff.js](https://github.com/geotiffjs/geotiff.js) library to be loaded as well.
227
- *
228
- * @api
229
- */
230
- declare class GeoTIFFSource extends DataTile<import("ol/DataTile.js").default> {
231
- /**
232
- * @param {Options} options Data tile options.
233
- */
234
- constructor(options: Options);
235
- /**
236
- * @type {Array<SourceInfo>}
237
- * @private
238
- */
239
- private sourceInfo_;
240
- /**
241
- * @type {Object}
242
- * @private
243
- */
244
- private sourceOptions_;
245
- /**
246
- * @type {Array<Array<GeoTIFFImage>>}
247
- * @private
248
- */
249
- private sourceImagery_;
250
- /**
251
- * @type {Array<Array<GeoTIFFImage>>}
252
- * @private
253
- */
254
- private sourceMasks_;
255
- /**
256
- * @type {Array<number>}
257
- * @private
258
- */
259
- private resolutionFactors_;
260
- /**
261
- * @type {Array<number>}
262
- * @private
263
- */
264
- private samplesPerPixel_;
265
- /**
266
- * @type {Array<Array<number>>}
267
- * @private
268
- */
269
- private nodataValues_;
270
- /**
271
- * @type {Array<Array<GDALMetadata>>}
272
- * @private
273
- */
274
- private metadata_;
275
- /**
276
- * @type {boolean}
277
- * @private
278
- */
279
- private normalize_;
280
- /**
281
- * @type {boolean}
282
- * @private
283
- */
284
- private addAlpha_;
285
- /**
286
- * @type {Error}
287
- * @private
288
- */
289
- private error_;
290
- /**
291
- * @type {true|false|'auto'}
292
- * @private
293
- */
294
- private convertToRGB_;
295
- /**
296
- * @type {boolean}
297
- * @private
298
- */
299
- private loadMissingProjection_;
300
- /**
301
- * @return {Error} A source loading error. When the source state is `error`, use this function
302
- * to get more information about the error. To debug a faulty configuration, you may want to use
303
- * a listener like
304
- * ```js
305
- * geotiffSource.on('change', () => {
306
- * if (geotiffSource.getState() === 'error') {
307
- * console.error(geotiffSource.getError());
308
- * }
309
- * });
310
- * ```
311
- */
312
- getError(): Error;
313
- /**
314
- * Determine the projection of the images in this GeoTIFF.
315
- * The default implementation looks at the ProjectedCSTypeGeoKey and the GeographicTypeGeoKey
316
- * of each image in turn.
317
- * You can override this method in a subclass to support more projections.
318
- *
319
- * @async
320
- * @param {Array<Array<GeoTIFFImage>>} sources Each source is a list of images
321
- * from a single GeoTIFF.
322
- */
323
- determineProjection(sources: Array<Array<GeoTIFFImage>>): Promise<void>;
324
- /**
325
- * Determine any transform matrix for the images in this GeoTIFF.
326
- *
327
- * @param {Array<Array<GeoTIFFImage>>} sources Each source is a list of images
328
- * from a single GeoTIFF.
329
- */
330
- determineTransformMatrix(sources: Array<Array<GeoTIFFImage>>): void;
331
- /**
332
- * Configure the tile grid based on images within the source GeoTIFFs. Each GeoTIFF
333
- * must have the same internal tiled structure.
334
- * @param {Array<Array<GeoTIFFImage>>} sources Each source is a list of images
335
- * from a single GeoTIFF.
336
- * @private
337
- * @async
338
- */
339
- private configure_;
340
- /**
341
- * @param {number} z The z tile index.
342
- * @param {number} x The x tile index.
343
- * @param {number} y The y tile index.
344
- * @param {import('ol/source/DataTile.js').LoaderOptions} options The loader options.
345
- * @return {Promise} The composed tile data.
346
- * @private
347
- */
348
- private loadTile_;
349
- /**
350
- * @param {import("ol/size.js").Size} sourceTileSize The source tile size.
351
- * @param {Array} sourceSamples The source samples.
352
- * @return {import("ol/DataTile.js").Data} The composed tile data.
353
- * @private
354
- */
355
- private composeTile_;
356
- }
357
- import DataTile_1 from 'ol/source/DataTile.js';
358
- //# sourceMappingURL=GeoTIFF.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GeoTIFF.d.ts","sourceRoot":"","sources":["../../../src/ol/source/GeoTIFF.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA4Fc,MAAM;;;;wBACN,MAAM;;;;4BACN,MAAM;;;;6BACN,MAAM;;;;6BACN,MAAM;;;;0BACN,MAAM;;;;2BACN,MAAM;;;;2BACN,MAAM;;sBAIP,OAAO,SAAS,EAAE,OAAO;2BAIzB,OAAO,SAAS,EAAE,YAAY;;;;;wBAK7B,MAAM;;;;wBACN,MAAM;;2BASP,OAAO,SAAS,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAsP7B,MAAM,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;iBAiBjB,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;AAjCjD;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EA+GjB;IAnGC;;;OAGG;IACH,oBAAkC;IAIlC;;;OAGG;IACH,uBAA2C;IAE3C;;;OAGG;IACH,uBAA2C;IAE3C;;;OAGG;IACH,qBAAyC;IAEzC;;;OAGG;IACH,2BAA+C;IAE/C;;;OAGG;IACH,yBAAqB;IAErB;;;OAGG;IACH,sBAAkB;IAElB;;;OAGG;IACH,kBAAc;IAEd;;;OAGG;IACH,mBAA6C;IAE7C;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,eAAkB;IAElB;;;OAGG;IACH,sBAAkD;IAElD;;;OAGG;IACH,+BAAoE;IAuBtE;;;;;;;;;;;OAWG;IACH,YAXY,KAAK,CAahB;IAED;;;;;;;;;OASG;IACH,6BAHW,MAAM,MAAM,YAAY,CAAC,CAAC,iBAgBpC;IAED;;;;;OAKG;IACH,kCAHW,MAAM,MAAM,YAAY,CAAC,CAAC,QA8BpC;IAED;;;;;;;OAOG;IACH,mBAkPC;IAED;;;;;;;OAOG;IACH,kBA8EC;IAED;;;;;OAKG;IACH,qBA4GC;CACF;uBArgCoB,uBAAuB"}