@cogeotiff/core 8.1.0 → 9.0.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.
- package/CHANGELOG.md +32 -0
- package/README.md +45 -7
- package/build/__benchmark__/cog.read.benchmark.js +5 -5
- package/build/__benchmark__/cog.read.benchmark.js.map +1 -1
- package/build/__benchmark__/source.file.js +9 -2
- package/build/__benchmark__/source.file.js.map +1 -1
- package/build/__test__/cog.image.test.js +14 -9
- package/build/__test__/cog.image.test.js.map +1 -1
- package/build/__test__/cog.read.test.js +50 -8
- package/build/__test__/cog.read.test.js.map +1 -1
- package/build/__test__/example.js +2 -2
- package/build/__test__/example.js.map +1 -1
- package/build/const/index.d.ts +1 -1
- package/build/const/index.js +1 -1
- package/build/const/index.js.map +1 -1
- package/build/const/tiff.mime.d.ts +11 -5
- package/build/const/tiff.mime.js +27 -14
- package/build/const/tiff.mime.js.map +1 -1
- package/build/const/tiff.tag.id.d.ts +603 -41
- package/build/const/tiff.tag.id.js +479 -50
- package/build/const/tiff.tag.id.js.map +1 -1
- package/build/const/tiff.tag.value.js +1 -1
- package/build/const/tiff.tag.value.js.map +1 -1
- package/build/index.d.ts +6 -4
- package/build/index.js +6 -3
- package/build/index.js.map +1 -1
- package/build/read/tiff.gdal.d.ts +1 -1
- package/build/read/tiff.gdal.js +1 -1
- package/build/read/tiff.gdal.js.map +1 -1
- package/build/read/tiff.ifd.config.js +1 -1
- package/build/read/tiff.ifd.config.js.map +1 -1
- package/build/read/tiff.tag.d.ts +3 -0
- package/build/read/tiff.tag.factory.d.ts +5 -5
- package/build/read/tiff.tag.factory.js +22 -13
- package/build/read/tiff.tag.factory.js.map +1 -1
- package/build/read/tiff.value.reader.d.ts +1 -1
- package/build/read/tiff.value.reader.js.map +1 -1
- package/build/{cog.tiff.d.ts → tiff.d.ts} +12 -10
- package/build/{cog.tiff.image.d.ts → tiff.image.d.ts} +69 -27
- package/build/{cog.tiff.image.js → tiff.image.js} +131 -82
- package/build/tiff.image.js.map +1 -0
- package/build/{cog.tiff.js → tiff.js} +17 -10
- package/build/tiff.js.map +1 -0
- package/build/util/bytes.d.ts +4 -2
- package/build/util/bytes.js +5 -2
- package/build/util/bytes.js.map +1 -1
- package/package.json +2 -2
- package/src/__benchmark__/cog.read.benchmark.ts +6 -5
- package/src/__benchmark__/source.file.ts +10 -2
- package/src/__test__/cog.image.test.ts +17 -9
- package/src/__test__/cog.read.test.ts +65 -9
- package/src/__test__/example.ts +3 -2
- package/src/const/index.ts +1 -1
- package/src/const/tiff.mime.ts +28 -14
- package/src/const/tiff.tag.id.ts +758 -131
- package/src/const/tiff.tag.value.ts +16 -16
- package/src/index.ts +20 -4
- package/src/read/tiff.gdal.ts +1 -1
- package/src/read/tiff.ifd.config.ts +1 -1
- package/src/read/tiff.tag.factory.ts +33 -17
- package/src/read/tiff.tag.ts +3 -0
- package/src/read/tiff.value.reader.ts +1 -1
- package/src/{cog.tiff.image.ts → tiff.image.ts} +140 -91
- package/src/{cog.tiff.ts → tiff.ts} +18 -16
- package/src/util/bytes.ts +5 -1
- package/build/cog.tiff.image.js.map +0 -1
- package/build/cog.tiff.js.map +0 -1
|
@@ -1,10 +1,294 @@
|
|
|
1
|
+
/** Sub file type for tag 254 {@link TiffTag.SubFileType} */
|
|
2
|
+
export declare enum SubFileType {
|
|
3
|
+
/** Reduced resolution version */
|
|
4
|
+
ReducedImage = 1,
|
|
5
|
+
/** One page of many */
|
|
6
|
+
Page = 2,
|
|
7
|
+
/** Transparency mask */
|
|
8
|
+
Mask = 4
|
|
9
|
+
}
|
|
10
|
+
export declare enum Orientation {
|
|
11
|
+
TopLeft = 1,
|
|
12
|
+
TopRight = 2,
|
|
13
|
+
BottomRight = 3,
|
|
14
|
+
BottomLeft = 4,
|
|
15
|
+
LeftTop = 5,
|
|
16
|
+
RightTOP = 6,
|
|
17
|
+
RightBottom = 7,
|
|
18
|
+
LeftBottom = 8
|
|
19
|
+
}
|
|
20
|
+
export declare enum RasterTypeKey {
|
|
21
|
+
/**
|
|
22
|
+
* PixelIsArea (default) a pixel is treated as an area,
|
|
23
|
+
* the raster coordinate (0,0) is the top left corner of the top left pixel.
|
|
24
|
+
*/
|
|
25
|
+
PixelIsArea = 1,
|
|
26
|
+
/**
|
|
27
|
+
* PixelIsPoint treats pixels as point samples with empty space between the "pixel" samples.
|
|
28
|
+
* the raster coordinate (0,0) is the location of the top left raster pixel.
|
|
29
|
+
*/
|
|
30
|
+
PixelIsPoint = 2
|
|
31
|
+
}
|
|
32
|
+
export declare enum ModelTypeCode {
|
|
33
|
+
/** Projection Coordinate System */
|
|
34
|
+
Projected = 1,
|
|
35
|
+
/** Geographic latitude-longitude System */
|
|
36
|
+
Geographic = 2,
|
|
37
|
+
/** Geocentric (X,Y,Z) Coordinate System */
|
|
38
|
+
Geocentric = 3
|
|
39
|
+
}
|
|
40
|
+
/** Sub file type for tag 255 {@link TiffTag.OldSubFileType} */
|
|
41
|
+
export declare enum OldSubFileType {
|
|
42
|
+
/** Full resolution image data */
|
|
43
|
+
Image = 1,
|
|
44
|
+
/** Reduced resolution version */
|
|
45
|
+
ReducedImage = 2,
|
|
46
|
+
/** One page of many */
|
|
47
|
+
Page = 3
|
|
48
|
+
}
|
|
49
|
+
/** Tiff compression types */
|
|
50
|
+
export declare enum Compression {
|
|
51
|
+
None = 1,
|
|
52
|
+
Lzw = 5,
|
|
53
|
+
Jpeg6 = 6,
|
|
54
|
+
Jpeg = 7,
|
|
55
|
+
DeflateOther = 8,
|
|
56
|
+
Deflate = 32946,
|
|
57
|
+
Jp2000 = 3417,
|
|
58
|
+
Lerc = 34887,
|
|
59
|
+
Lzma = 34925,
|
|
60
|
+
Zstd = 50000,
|
|
61
|
+
Webp = 50001,
|
|
62
|
+
JpegXl = 50002
|
|
63
|
+
}
|
|
64
|
+
export declare enum PlanarConfiguration {
|
|
65
|
+
/** single image plane */
|
|
66
|
+
Contig = 1,
|
|
67
|
+
/** separate planes of data */
|
|
68
|
+
Separate = 2
|
|
69
|
+
}
|
|
70
|
+
export declare enum SampleFormat {
|
|
71
|
+
/** Unsigned integer data */
|
|
72
|
+
Uint = 1,
|
|
73
|
+
/** Signed integer data */
|
|
74
|
+
Int = 2,
|
|
75
|
+
/** IEEE floating point data */
|
|
76
|
+
Float = 3,
|
|
77
|
+
/** Untyped data */
|
|
78
|
+
Void = 4,
|
|
79
|
+
/** Complex signed int */
|
|
80
|
+
ComplexInt = 5,
|
|
81
|
+
/** Complex ieee floating */
|
|
82
|
+
ComplexFloat = 6
|
|
83
|
+
}
|
|
84
|
+
export declare enum Photometric {
|
|
85
|
+
/** min value is white */
|
|
86
|
+
MinIsWhite = 0,
|
|
87
|
+
/** min value is black */
|
|
88
|
+
MinIsBlack = 1,
|
|
89
|
+
/** RGB color model */
|
|
90
|
+
Rgb = 2,
|
|
91
|
+
/** color map indexed */
|
|
92
|
+
Palette = 3,
|
|
93
|
+
/** $holdout mask */
|
|
94
|
+
Mask = 4,
|
|
95
|
+
/** !color separations */
|
|
96
|
+
Separated = 5,
|
|
97
|
+
/** !CCIR 601 */
|
|
98
|
+
Ycbcr = 6,
|
|
99
|
+
/** !1976 CIE L*a*b* */
|
|
100
|
+
Cielab = 8,
|
|
101
|
+
/** ICC L*a*b* [Adobe TIFF Technote 4] */
|
|
102
|
+
Icclab = 9,
|
|
103
|
+
/** ITU L*a*b* */
|
|
104
|
+
Itulab = 10,
|
|
105
|
+
/** color filter array */
|
|
106
|
+
Cfa = 32803,
|
|
107
|
+
/** CIE Log2(L) */
|
|
108
|
+
Logl = 32844,
|
|
109
|
+
Logluv = 32845
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Tiff tags as defined by libtiff and libgeotiff
|
|
113
|
+
*
|
|
114
|
+
* - {@link https://gitlab.com/libtiff/libtiff}
|
|
115
|
+
* - {@link https://github.com/OSGeo/libgeotiff/}
|
|
116
|
+
*/
|
|
1
117
|
export declare enum TiffTag {
|
|
2
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Type of the sub file
|
|
120
|
+
*
|
|
121
|
+
* @see {@link SubFileType}
|
|
122
|
+
*/
|
|
123
|
+
SubFileType = 254,
|
|
124
|
+
/**
|
|
125
|
+
* Type of sub file
|
|
126
|
+
*
|
|
127
|
+
* @see {@link OldSubFileType}
|
|
128
|
+
*/
|
|
129
|
+
OldSubFileType = 255,
|
|
130
|
+
/** Width of image in pixels */
|
|
131
|
+
ImageWidth = 256,
|
|
132
|
+
/** Height of image in pixels */
|
|
133
|
+
ImageHeight = 257,
|
|
134
|
+
/**
|
|
135
|
+
* Number of bits per channel
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* [8,8,8] // 8 bit RGB
|
|
140
|
+
* [16] // 16bit
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
3
143
|
BitsPerSample = 258,
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* Data type of the image
|
|
147
|
+
*
|
|
148
|
+
* See {@link SampleFormat}
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* [1] // SampleFormat.Uint
|
|
153
|
+
* [1,1,1,1] // 4 band Uint
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
SampleFormat = 339,
|
|
157
|
+
/**
|
|
158
|
+
* Compression Type
|
|
159
|
+
*
|
|
160
|
+
* @see {@link Compression}
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* 5 // Compression.Lzw
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
Compression = 259,
|
|
168
|
+
/**
|
|
169
|
+
* Photometric interpretation
|
|
170
|
+
*
|
|
171
|
+
* @see {@link Photometric}
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* 2 // Photometric.Rgb
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
Photometric = 262,
|
|
179
|
+
/** Tile width in pixels */
|
|
180
|
+
TileWidth = 322,
|
|
181
|
+
/** Tile height in pixels */
|
|
182
|
+
TileHeight = 323,
|
|
183
|
+
/**
|
|
184
|
+
* Offsets to data tiles
|
|
185
|
+
* `0` means the tile has no data (sparse tiff)
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* [0, 3200, 1406] // three tiles, first tile does not exist
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
TileOffsets = 324,
|
|
193
|
+
/**
|
|
194
|
+
* Byte counts for tiles
|
|
195
|
+
* `0 means the tile does not exist (sparse tiff)
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* [0, 3200, 1406] // three tiles, first tile does not exist
|
|
200
|
+
* ```
|
|
201
|
+
**/
|
|
202
|
+
TileByteCounts = 325,
|
|
203
|
+
/** JPEG table stream */
|
|
204
|
+
JpegTables = 347,
|
|
205
|
+
StripOffsets = 273,
|
|
206
|
+
StripByteCounts = 279,
|
|
207
|
+
/**
|
|
208
|
+
* GDAL metadata
|
|
209
|
+
* Generally a xml document with lots of information about the tiff and how it was created
|
|
210
|
+
*/
|
|
211
|
+
GdalMetadata = 42112,
|
|
212
|
+
/**
|
|
213
|
+
* No data value encoded as a string
|
|
214
|
+
*
|
|
215
|
+
* @example "-9999"
|
|
216
|
+
*/
|
|
217
|
+
GdalNoData = 42113,
|
|
218
|
+
/** GeoTiff Tags */
|
|
219
|
+
/**
|
|
220
|
+
* Pixel scale in meters
|
|
221
|
+
* in the format [scaleX, scaleY, scaleZ]
|
|
222
|
+
*
|
|
223
|
+
* Requires {@link ModelTiePoint} to be set and {@link ModelTransformation} not to be set
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```typescript
|
|
227
|
+
* [100.0, 100.0, 0.0]
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
ModelPixelScale = 33550,
|
|
231
|
+
/**
|
|
232
|
+
* Position of the tiff
|
|
233
|
+
*
|
|
234
|
+
* contains a list of tie points that contain
|
|
235
|
+
* [x,y,z] of position in the in the tiff, generally [0,0,0]
|
|
236
|
+
* [x,y,z] of the position in the projected
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* Mapping tiff point `[0,0,0]` to projected coordinates `[350807.4, 5316081.3, 0.0]`
|
|
240
|
+
* ```
|
|
241
|
+
* [0, 0, 0, 350807.4, 5316081.3, 0.0]
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
ModelTiePoint = 33922,
|
|
245
|
+
/**
|
|
246
|
+
* Exact affine transformation between the tiff and the projected location
|
|
247
|
+
*
|
|
248
|
+
* this tag should not be defined when {@link ModelTiePoint} or {@link ModelPixelScale} are used
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
*```typescript
|
|
252
|
+
* [ 0, 100.0, 0, 400000.0,
|
|
253
|
+
* 100.0, 0, 0, 500000.0,
|
|
254
|
+
* 0, 0, 0, 0,
|
|
255
|
+
* 0, 0, 0, 1]
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
ModelTransformation = 34744,
|
|
259
|
+
/**
|
|
260
|
+
* List of GeoTiff tags
|
|
261
|
+
* {@link TiffTagGeo}
|
|
262
|
+
*
|
|
263
|
+
* {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_geokeydirectorytag}
|
|
264
|
+
*/
|
|
265
|
+
GeoKeyDirectory = 34735,
|
|
266
|
+
/**
|
|
267
|
+
* Double Parameters for GeoTiff Tags
|
|
268
|
+
*
|
|
269
|
+
* {@link TiffTagGeo}
|
|
270
|
+
*/
|
|
271
|
+
GeoDoubleParams = 34736,
|
|
272
|
+
/**
|
|
273
|
+
* Ascii Parameters for GeoTiff Tags
|
|
274
|
+
*
|
|
275
|
+
* {@link TiffTagGeo}
|
|
276
|
+
*/
|
|
277
|
+
GeoAsciiParams = 34737,
|
|
278
|
+
/**
|
|
279
|
+
* Stores the LERC version and additional compression
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* ```typescript
|
|
283
|
+
* [4, 0] // version 4, no extra compression
|
|
284
|
+
* ```
|
|
285
|
+
*/
|
|
286
|
+
LercParameters = 50674,
|
|
287
|
+
PlanarConfiguration = 284,
|
|
288
|
+
/** Untyped values */
|
|
4
289
|
CellLength = 265,
|
|
5
290
|
CellWidth = 264,
|
|
6
291
|
ColorMap = 320,
|
|
7
|
-
Compression = 259,
|
|
8
292
|
Copyright = 33432,
|
|
9
293
|
DateTime = 306,
|
|
10
294
|
ExtraSamples = 338,
|
|
@@ -15,23 +299,15 @@ export declare enum TiffTag {
|
|
|
15
299
|
GrayResponseUnit = 290,
|
|
16
300
|
HostComputer = 316,
|
|
17
301
|
ImageDescription = 270,
|
|
18
|
-
ImageHeight = 257,
|
|
19
|
-
ImageWidth = 256,
|
|
20
302
|
Make = 271,
|
|
21
303
|
MaxSampleValue = 281,
|
|
22
304
|
MinSampleValue = 280,
|
|
23
305
|
Model = 272,
|
|
24
|
-
NewSubFileType = 254,
|
|
25
306
|
Orientation = 274,
|
|
26
|
-
PhotometricInterpretation = 262,
|
|
27
|
-
PlanarConfiguration = 284,
|
|
28
307
|
ResolutionUnit = 296,
|
|
29
308
|
RowsPerStrip = 278,
|
|
30
309
|
SamplesPerPixel = 277,
|
|
31
310
|
Software = 305,
|
|
32
|
-
StripByteCounts = 279,
|
|
33
|
-
StripOffsets = 273,
|
|
34
|
-
SubFileType = 255,
|
|
35
311
|
Threshholding = 263,
|
|
36
312
|
XResolution = 282,
|
|
37
313
|
YResolution = 283,
|
|
@@ -45,23 +321,17 @@ export declare enum TiffTag {
|
|
|
45
321
|
DotRange = 336,
|
|
46
322
|
HalftoneHints = 321,
|
|
47
323
|
Indexed = 346,
|
|
48
|
-
JPEGTables = 347,
|
|
49
324
|
PageName = 285,
|
|
50
325
|
PageNumber = 297,
|
|
51
326
|
Predictor = 317,
|
|
52
327
|
PrimaryChromaticities = 319,
|
|
53
328
|
ReferenceBlackWhite = 532,
|
|
54
|
-
SampleFormat = 339,
|
|
55
329
|
SMinSampleValue = 340,
|
|
56
330
|
SMaxSampleValue = 341,
|
|
57
331
|
StripRowCounts = 559,
|
|
58
332
|
SubIFDs = 330,
|
|
59
333
|
T4Options = 292,
|
|
60
334
|
T6Options = 293,
|
|
61
|
-
TileByteCounts = 325,
|
|
62
|
-
TileHeight = 323,
|
|
63
|
-
TileOffsets = 324,
|
|
64
|
-
TileWidth = 322,
|
|
65
335
|
TransferFunction = 301,
|
|
66
336
|
WhitePoint = 318,
|
|
67
337
|
XClipPathUnits = 344,
|
|
@@ -89,41 +359,220 @@ export declare enum TiffTag {
|
|
|
89
359
|
UserComment = 37510,
|
|
90
360
|
IPTC = 33723,
|
|
91
361
|
ICCProfile = 34675,
|
|
92
|
-
XMP = 700
|
|
93
|
-
GdalMetadata = 42112,
|
|
94
|
-
GdalNoData = 42113,
|
|
95
|
-
LercParams = 50674,
|
|
96
|
-
Photoshop = 34377,
|
|
97
|
-
ModelPixelScale = 33550,
|
|
98
|
-
ModelTiePoint = 33922,
|
|
99
|
-
ModelTransformation = 34264,
|
|
100
|
-
GeoKeyDirectory = 34735,
|
|
101
|
-
GeoDoubleParams = 34736,
|
|
102
|
-
GeoAsciiParams = 34737
|
|
362
|
+
XMP = 700
|
|
103
363
|
}
|
|
364
|
+
/** Define the expected types for all the tiff tags */
|
|
365
|
+
export interface TiffTagType {
|
|
366
|
+
[TiffTag.ImageHeight]: number;
|
|
367
|
+
[TiffTag.ImageWidth]: number;
|
|
368
|
+
[TiffTag.SubFileType]: SubFileType;
|
|
369
|
+
[TiffTag.BitsPerSample]: number[];
|
|
370
|
+
[TiffTag.Compression]: Compression;
|
|
371
|
+
[TiffTag.OldSubFileType]: OldSubFileType;
|
|
372
|
+
[TiffTag.Photometric]: Photometric;
|
|
373
|
+
[TiffTag.TileWidth]: number;
|
|
374
|
+
[TiffTag.TileHeight]: number;
|
|
375
|
+
[TiffTag.TileOffsets]: number[];
|
|
376
|
+
[TiffTag.TileByteCounts]: number[];
|
|
377
|
+
[TiffTag.JpegTables]: number[];
|
|
378
|
+
[TiffTag.StripByteCounts]: number[];
|
|
379
|
+
[TiffTag.StripOffsets]: number[];
|
|
380
|
+
[TiffTag.SampleFormat]: SampleFormat[];
|
|
381
|
+
[TiffTag.GdalMetadata]: string;
|
|
382
|
+
[TiffTag.GdalNoData]: string;
|
|
383
|
+
[TiffTag.ModelPixelScale]: number[];
|
|
384
|
+
[TiffTag.ModelTiePoint]: number[];
|
|
385
|
+
[TiffTag.ModelTransformation]: number[];
|
|
386
|
+
[TiffTag.GeoKeyDirectory]: number[];
|
|
387
|
+
[TiffTag.GeoDoubleParams]: number[];
|
|
388
|
+
[TiffTag.GeoAsciiParams]: string;
|
|
389
|
+
[TiffTag.PlanarConfiguration]: PlanarConfiguration;
|
|
390
|
+
[TiffTag.Orientation]: Orientation;
|
|
391
|
+
[TiffTag.LercParameters]: number[];
|
|
392
|
+
[TiffTag.CellLength]: unknown;
|
|
393
|
+
[TiffTag.CellWidth]: unknown;
|
|
394
|
+
[TiffTag.ColorMap]: unknown;
|
|
395
|
+
[TiffTag.Copyright]: unknown;
|
|
396
|
+
[TiffTag.DateTime]: unknown;
|
|
397
|
+
[TiffTag.ExtraSamples]: unknown;
|
|
398
|
+
[TiffTag.FillOrder]: unknown;
|
|
399
|
+
[TiffTag.FreeByteCounts]: unknown;
|
|
400
|
+
[TiffTag.FreeOffsets]: unknown;
|
|
401
|
+
[TiffTag.GrayResponseCurve]: unknown;
|
|
402
|
+
[TiffTag.GrayResponseUnit]: unknown;
|
|
403
|
+
[TiffTag.HostComputer]: unknown;
|
|
404
|
+
[TiffTag.ImageDescription]: unknown;
|
|
405
|
+
[TiffTag.Make]: unknown;
|
|
406
|
+
[TiffTag.MaxSampleValue]: unknown;
|
|
407
|
+
[TiffTag.MinSampleValue]: unknown;
|
|
408
|
+
[TiffTag.Model]: unknown;
|
|
409
|
+
[TiffTag.ResolutionUnit]: unknown;
|
|
410
|
+
[TiffTag.RowsPerStrip]: unknown;
|
|
411
|
+
[TiffTag.SamplesPerPixel]: unknown;
|
|
412
|
+
[TiffTag.Software]: unknown;
|
|
413
|
+
[TiffTag.Threshholding]: unknown;
|
|
414
|
+
[TiffTag.XResolution]: unknown;
|
|
415
|
+
[TiffTag.YResolution]: unknown;
|
|
416
|
+
[TiffTag.BadFaxLines]: unknown;
|
|
417
|
+
[TiffTag.CleanFaxData]: unknown;
|
|
418
|
+
[TiffTag.ClipPath]: unknown;
|
|
419
|
+
[TiffTag.ConsecutiveBadFaxLines]: unknown;
|
|
420
|
+
[TiffTag.Decode]: unknown;
|
|
421
|
+
[TiffTag.DefaultImageColor]: unknown;
|
|
422
|
+
[TiffTag.DocumentName]: unknown;
|
|
423
|
+
[TiffTag.DotRange]: unknown;
|
|
424
|
+
[TiffTag.HalftoneHints]: unknown;
|
|
425
|
+
[TiffTag.Indexed]: unknown;
|
|
426
|
+
[TiffTag.PageName]: unknown;
|
|
427
|
+
[TiffTag.PageNumber]: unknown;
|
|
428
|
+
[TiffTag.Predictor]: unknown;
|
|
429
|
+
[TiffTag.PrimaryChromaticities]: unknown;
|
|
430
|
+
[TiffTag.ReferenceBlackWhite]: unknown;
|
|
431
|
+
[TiffTag.SMinSampleValue]: unknown;
|
|
432
|
+
[TiffTag.SMaxSampleValue]: unknown;
|
|
433
|
+
[TiffTag.StripRowCounts]: unknown;
|
|
434
|
+
[TiffTag.SubIFDs]: unknown;
|
|
435
|
+
[TiffTag.T4Options]: unknown;
|
|
436
|
+
[TiffTag.T6Options]: unknown;
|
|
437
|
+
[TiffTag.TransferFunction]: unknown;
|
|
438
|
+
[TiffTag.WhitePoint]: unknown;
|
|
439
|
+
[TiffTag.XClipPathUnits]: unknown;
|
|
440
|
+
[TiffTag.XPosition]: unknown;
|
|
441
|
+
[TiffTag.YCbCrCoefficients]: unknown;
|
|
442
|
+
[TiffTag.YCbCrPositioning]: unknown;
|
|
443
|
+
[TiffTag.YCbCrSubSampling]: unknown;
|
|
444
|
+
[TiffTag.YClipPathUnits]: unknown;
|
|
445
|
+
[TiffTag.YPosition]: unknown;
|
|
446
|
+
[TiffTag.ApertureValue]: unknown;
|
|
447
|
+
[TiffTag.ColorSpace]: unknown;
|
|
448
|
+
[TiffTag.DateTimeDigitized]: unknown;
|
|
449
|
+
[TiffTag.DateTimeOriginal]: unknown;
|
|
450
|
+
[TiffTag.ExifIFD]: unknown;
|
|
451
|
+
[TiffTag.ExifVersion]: unknown;
|
|
452
|
+
[TiffTag.ExposureTime]: unknown;
|
|
453
|
+
[TiffTag.FileSource]: unknown;
|
|
454
|
+
[TiffTag.Flash]: unknown;
|
|
455
|
+
[TiffTag.FlashpixVersion]: unknown;
|
|
456
|
+
[TiffTag.FNumber]: unknown;
|
|
457
|
+
[TiffTag.ImageUniqueID]: unknown;
|
|
458
|
+
[TiffTag.LightSource]: unknown;
|
|
459
|
+
[TiffTag.MakerNote]: unknown;
|
|
460
|
+
[TiffTag.ShutterSpeedValue]: unknown;
|
|
461
|
+
[TiffTag.UserComment]: unknown;
|
|
462
|
+
[TiffTag.IPTC]: unknown;
|
|
463
|
+
[TiffTag.ICCProfile]: unknown;
|
|
464
|
+
[TiffTag.XMP]: unknown;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Geotiff tags as defined by OGC GeoTiff 1.1
|
|
468
|
+
*
|
|
469
|
+
* {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_summary_of_geokey_ids_and_names}
|
|
470
|
+
*/
|
|
104
471
|
export declare enum TiffTagGeo {
|
|
472
|
+
/**
|
|
473
|
+
* This GeoKey defines the type of Model coordinate reference system used, to which the transformation from the raster space is made:
|
|
474
|
+
*
|
|
475
|
+
* {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_gtmodeltypegeokey}
|
|
476
|
+
*
|
|
477
|
+
* {@link ModelTypeCode}
|
|
478
|
+
*/
|
|
105
479
|
GTModelTypeGeoKey = 1024,
|
|
480
|
+
/**
|
|
481
|
+
* There are currently only two options: `RasterPixelIsPoint` and `RasterPixelIsArea`
|
|
482
|
+
*
|
|
483
|
+
* {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_gtrastertypegeokey}
|
|
484
|
+
*
|
|
485
|
+
* {@link RasterTypeKey}
|
|
486
|
+
*/
|
|
106
487
|
GTRasterTypeGeoKey = 1025,
|
|
488
|
+
/**
|
|
489
|
+
* ASCII reference to published documentation on the overall configuration of the GeoTIFF file.
|
|
490
|
+
*
|
|
491
|
+
* @example "NZGD2000 / New Zealand Transverse Mercator 2000"
|
|
492
|
+
*/
|
|
107
493
|
GTCitationGeoKey = 1026,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
494
|
+
/**
|
|
495
|
+
* Renamed from GeographicTypeGeoKey in OGC GeoTiff
|
|
496
|
+
*/
|
|
497
|
+
GeodeticCRSGeoKey = 2048,
|
|
498
|
+
/**
|
|
499
|
+
* Renamed from GeogCitationGeoKey in OGC GeoTiff
|
|
500
|
+
*
|
|
501
|
+
* @example "NZTM"
|
|
502
|
+
*/
|
|
503
|
+
GeodeticCitationGeoKey = 2049,
|
|
504
|
+
/**
|
|
505
|
+
* Renamed from GeogGeodeticDatumGeoKey in OGC GeoTiff
|
|
506
|
+
*/
|
|
507
|
+
GeodeticDatumGeoKey = 2050,
|
|
508
|
+
/**
|
|
509
|
+
* Renamed from "GeogPrimeMeridianGeoKey" in OGC GeoTiff
|
|
510
|
+
*/
|
|
511
|
+
PrimeMeridianGeoKey = 2051,
|
|
512
|
+
/**
|
|
513
|
+
* Linear unit of measure
|
|
514
|
+
* @example 9001 // Metre
|
|
515
|
+
*/
|
|
112
516
|
GeogLinearUnitsGeoKey = 2052,
|
|
113
517
|
GeogLinearUnitSizeGeoKey = 2053,
|
|
518
|
+
/**
|
|
519
|
+
* Angular unit of measure
|
|
520
|
+
*
|
|
521
|
+
* @example 9102 // Degree
|
|
522
|
+
*/
|
|
114
523
|
GeogAngularUnitsGeoKey = 2054,
|
|
115
524
|
GeogAngularUnitSizeGeoKey = 2055,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
525
|
+
/**
|
|
526
|
+
* Renamed from "GeogEllipsoidGeoKey" in OGC GeoTiff
|
|
527
|
+
*/
|
|
528
|
+
EllipsoidGeoKey = 2056,
|
|
529
|
+
/**
|
|
530
|
+
* Renamed from "GeogSemiMajorAxisGeoKey" in OGC GeoTiff
|
|
531
|
+
*/
|
|
532
|
+
EllipsoidSemiMajorAxisGeoKey = 2057,
|
|
533
|
+
/**
|
|
534
|
+
* Renamed from "GeogSemiMinorAxisGeoKey" in OGC GeoTiff
|
|
535
|
+
*/
|
|
536
|
+
EllipsoidSemiMinorAxisGeoKey = 2058,
|
|
537
|
+
/**
|
|
538
|
+
* Renamed from "GeogInvFlatteningGeoKey" in OGC GeoTiff
|
|
539
|
+
*/
|
|
540
|
+
EllipsoidInvFlatteningGeoKey = 2059,
|
|
541
|
+
/**
|
|
542
|
+
* Renamed from "GeogPrimeMeridianLongGeoKey" in OGC GeoTiff
|
|
543
|
+
*/
|
|
544
|
+
PrimeMeridianLongitudeGeoKey = 2061,
|
|
122
545
|
GeogTOWGS84GeoKey = 2062,
|
|
123
|
-
|
|
124
|
-
|
|
546
|
+
GeogAzimuthUnitsGeoKey = 2060,
|
|
547
|
+
/**
|
|
548
|
+
* EPSG code of the tiff
|
|
549
|
+
*
|
|
550
|
+
* Renamed from "ProjectedCSTypeGeoKey" in OGC GeoTiff
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* ```typescript
|
|
554
|
+
* 2193 // NZTM
|
|
555
|
+
* 3857 // WebMercatorQuad
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
ProjectedCRSGeoKey = 3072,
|
|
559
|
+
/**
|
|
560
|
+
* ASCII reference to published documentation on the Projected Coordinate System
|
|
561
|
+
*
|
|
562
|
+
* Renamed from "PCSCitationGeoKey" in OGC GeoTiff
|
|
563
|
+
*
|
|
564
|
+
* @example "UTM Zone 60 N with WGS 84"
|
|
565
|
+
*/
|
|
566
|
+
ProjectedCitationGeoKey = 3073,
|
|
567
|
+
/**
|
|
568
|
+
* Specifies a map projection from the GeoTIFF CRS register or to indicate that the map projection is user-defined.
|
|
569
|
+
*
|
|
570
|
+
* {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_map_projection_geokeys}
|
|
571
|
+
*
|
|
572
|
+
* @example 2193
|
|
573
|
+
*/
|
|
125
574
|
ProjectionGeoKey = 3074,
|
|
126
|
-
|
|
575
|
+
ProjMethodGeoKey = 3075,
|
|
127
576
|
ProjLinearUnitsGeoKey = 3076,
|
|
128
577
|
ProjLinearUnitSizeGeoKey = 3077,
|
|
129
578
|
ProjStdParallel1GeoKey = 3078,
|
|
@@ -145,8 +594,121 @@ export declare enum TiffTagGeo {
|
|
|
145
594
|
ProjAzimuthAngleGeoKey = 3094,
|
|
146
595
|
ProjStraightVertPoleLongGeoKey = 3095,
|
|
147
596
|
ProjRectifiedGridAngleGeoKey = 3096,
|
|
148
|
-
|
|
597
|
+
/**
|
|
598
|
+
* This key is provided to specify the vertical coordinate reference system from the GeoTIFF CRS register or to indicate that the CRS is a user-defined vertical coordinate reference system. The value for VerticalGeoKey should follow the
|
|
599
|
+
*
|
|
600
|
+
* {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_requirements_class_verticalgeokey}
|
|
601
|
+
*
|
|
602
|
+
* @example 4979
|
|
603
|
+
*/
|
|
604
|
+
VerticalGeoKey = 4096,
|
|
605
|
+
/**
|
|
606
|
+
*
|
|
607
|
+
* @example "Geographic 3D WGS 84, Ellipsoidal height"
|
|
608
|
+
*/
|
|
149
609
|
VerticalCitationGeoKey = 4097,
|
|
610
|
+
/**
|
|
611
|
+
* vertical datum for a user-defined vertical coordinate reference system.
|
|
612
|
+
*/
|
|
150
613
|
VerticalDatumGeoKey = 4098,
|
|
614
|
+
/**
|
|
615
|
+
* Linear Unit for vertical CRS
|
|
616
|
+
*
|
|
617
|
+
* @example 9001
|
|
618
|
+
*/
|
|
151
619
|
VerticalUnitsGeoKey = 4099
|
|
152
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* Define the types for all the geo tiff tags
|
|
623
|
+
*
|
|
624
|
+
* {@link https://docs.ogc.org/is/19-008r4/19-008r4.html#_summary_of_geokey_ids_and_names}
|
|
625
|
+
*/
|
|
626
|
+
export interface TiffTagGeoType {
|
|
627
|
+
[TiffTagGeo.GTModelTypeGeoKey]: ModelTypeCode;
|
|
628
|
+
[TiffTagGeo.GTRasterTypeGeoKey]: RasterTypeKey;
|
|
629
|
+
[TiffTagGeo.GTCitationGeoKey]: string;
|
|
630
|
+
[TiffTagGeo.GeodeticCRSGeoKey]: number;
|
|
631
|
+
[TiffTagGeo.GeodeticCitationGeoKey]: string;
|
|
632
|
+
[TiffTagGeo.GeodeticDatumGeoKey]: number;
|
|
633
|
+
[TiffTagGeo.PrimeMeridianGeoKey]: number;
|
|
634
|
+
[TiffTagGeo.GeogLinearUnitsGeoKey]: number;
|
|
635
|
+
[TiffTagGeo.GeogLinearUnitSizeGeoKey]: number;
|
|
636
|
+
[TiffTagGeo.GeogAngularUnitsGeoKey]: number;
|
|
637
|
+
[TiffTagGeo.GeogAngularUnitSizeGeoKey]: number;
|
|
638
|
+
[TiffTagGeo.EllipsoidGeoKey]: number;
|
|
639
|
+
[TiffTagGeo.EllipsoidSemiMajorAxisGeoKey]: number;
|
|
640
|
+
[TiffTagGeo.EllipsoidSemiMinorAxisGeoKey]: number;
|
|
641
|
+
[TiffTagGeo.EllipsoidInvFlatteningGeoKey]: number;
|
|
642
|
+
[TiffTagGeo.GeogAzimuthUnitsGeoKey]: number;
|
|
643
|
+
[TiffTagGeo.PrimeMeridianLongitudeGeoKey]: number;
|
|
644
|
+
[TiffTagGeo.GeogTOWGS84GeoKey]: number | number[];
|
|
645
|
+
[TiffTagGeo.ProjectedCRSGeoKey]: number;
|
|
646
|
+
[TiffTagGeo.ProjectedCitationGeoKey]: string;
|
|
647
|
+
[TiffTagGeo.ProjectionGeoKey]: number;
|
|
648
|
+
[TiffTagGeo.ProjMethodGeoKey]: number;
|
|
649
|
+
[TiffTagGeo.ProjLinearUnitsGeoKey]: number;
|
|
650
|
+
[TiffTagGeo.ProjLinearUnitSizeGeoKey]: number;
|
|
651
|
+
[TiffTagGeo.ProjStdParallel1GeoKey]: number;
|
|
652
|
+
[TiffTagGeo.ProjStdParallel2GeoKey]: number;
|
|
653
|
+
[TiffTagGeo.ProjNatOriginLongGeoKey]: number;
|
|
654
|
+
[TiffTagGeo.ProjNatOriginLatGeoKey]: number;
|
|
655
|
+
[TiffTagGeo.ProjFalseEastingGeoKey]: number;
|
|
656
|
+
[TiffTagGeo.ProjFalseNorthingGeoKey]: number;
|
|
657
|
+
[TiffTagGeo.ProjFalseOriginLongGeoKey]: number;
|
|
658
|
+
[TiffTagGeo.ProjFalseOriginLatGeoKey]: number;
|
|
659
|
+
[TiffTagGeo.ProjFalseOriginEastingGeoKey]: number;
|
|
660
|
+
[TiffTagGeo.ProjFalseOriginNorthingGeoKey]: number;
|
|
661
|
+
[TiffTagGeo.ProjCenterLongGeoKey]: number;
|
|
662
|
+
[TiffTagGeo.ProjCenterLatGeoKey]: number;
|
|
663
|
+
[TiffTagGeo.ProjCenterEastingGeoKey]: number;
|
|
664
|
+
[TiffTagGeo.ProjCenterNorthingGeoKey]: number;
|
|
665
|
+
[TiffTagGeo.ProjScaleAtNatOriginGeoKey]: number;
|
|
666
|
+
[TiffTagGeo.ProjScaleAtCenterGeoKey]: number;
|
|
667
|
+
[TiffTagGeo.ProjAzimuthAngleGeoKey]: number;
|
|
668
|
+
[TiffTagGeo.ProjStraightVertPoleLongGeoKey]: number;
|
|
669
|
+
[TiffTagGeo.ProjRectifiedGridAngleGeoKey]: number;
|
|
670
|
+
[TiffTagGeo.VerticalGeoKey]: number;
|
|
671
|
+
[TiffTagGeo.VerticalCitationGeoKey]: string;
|
|
672
|
+
[TiffTagGeo.VerticalDatumGeoKey]: number;
|
|
673
|
+
[TiffTagGeo.VerticalUnitsGeoKey]: number;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* EPSG Angular Units. exist between [9100, 9199]
|
|
677
|
+
*
|
|
678
|
+
* Taken from libegotiff
|
|
679
|
+
*/
|
|
680
|
+
export declare enum AngularUnit {
|
|
681
|
+
Radian = 9101,
|
|
682
|
+
Degree = 9102,
|
|
683
|
+
ArcMinute = 9103,
|
|
684
|
+
ArcDegree = 9104,
|
|
685
|
+
Grad = 9105,
|
|
686
|
+
Gon = 9106,
|
|
687
|
+
Dms = 9107
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* ESPG Liner units exist between [9000, 9099]
|
|
691
|
+
*
|
|
692
|
+
* Taken from libegotiff
|
|
693
|
+
*/
|
|
694
|
+
export declare enum LinearUnit {
|
|
695
|
+
Metre = 9001,
|
|
696
|
+
Foot = 9002,
|
|
697
|
+
FootUsSurvey = 9003,
|
|
698
|
+
FootModifiedAmerican = 9004,
|
|
699
|
+
FootClarke = 9005,
|
|
700
|
+
FootIndian = 9006,
|
|
701
|
+
Link = 9007,
|
|
702
|
+
LinkBenoit = 9008,
|
|
703
|
+
LinkSears = 9009,
|
|
704
|
+
ChainBenoit = 9010,
|
|
705
|
+
ChainSears = 9011,
|
|
706
|
+
YardSears = 9012,
|
|
707
|
+
YardIndian = 9013,
|
|
708
|
+
Fathom = 9014,
|
|
709
|
+
MileInternationalNautical = 9015
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Convert tiff tag values when being read.
|
|
713
|
+
*/
|
|
714
|
+
export declare const TiffTagConvertArray: Partial<Record<TiffTag, boolean>>;
|