@cogeotiff/core 7.2.0 → 8.0.1
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 +3 -500
- package/README.md +28 -10
- package/build/__benchmark__/cog.read.benchmark.d.ts +0 -1
- package/build/__benchmark__/cog.read.benchmark.js +6 -4
- package/build/__benchmark__/cog.read.benchmark.js.map +1 -0
- package/build/__benchmark__/source.file.d.ts +9 -0
- package/build/__benchmark__/source.file.js +29 -0
- package/build/__benchmark__/source.file.js.map +1 -0
- package/build/__benchmark__/source.memory.d.ts +9 -0
- package/build/__benchmark__/source.memory.js +32 -0
- package/build/__benchmark__/source.memory.js.map +1 -0
- package/build/__test__/cog.image.test.d.ts +1 -2
- package/build/__test__/cog.image.test.js +82 -90
- package/build/__test__/cog.image.test.js.map +1 -0
- package/build/__test__/cog.read.test.d.ts +1 -2
- package/build/__test__/cog.read.test.js +37 -55
- package/build/__test__/cog.read.test.js.map +1 -0
- package/build/__test__/example.d.ts +1 -0
- package/build/__test__/example.js +27 -0
- package/build/__test__/example.js.map +1 -0
- package/build/cog.tiff.d.ts +22 -28
- package/build/cog.tiff.image.d.ts +16 -28
- package/build/cog.tiff.image.js +147 -101
- package/build/cog.tiff.image.js.map +1 -0
- package/build/cog.tiff.js +141 -97
- package/build/cog.tiff.js.map +1 -0
- package/build/const/index.d.ts +1 -2
- package/build/const/index.js +2 -2
- package/build/const/index.js.map +1 -0
- package/build/const/tiff.endian.d.ts +0 -1
- package/build/const/tiff.endian.js +1 -1
- package/build/const/tiff.endian.js.map +1 -0
- package/build/const/tiff.mime.d.ts +10 -11
- package/build/const/tiff.mime.js +22 -22
- package/build/const/tiff.mime.js.map +1 -0
- package/build/const/tiff.tag.id.d.ts +5 -5
- package/build/const/tiff.tag.id.js +155 -154
- package/build/const/tiff.tag.id.js.map +1 -0
- package/build/const/tiff.tag.value.d.ts +15 -16
- package/build/const/tiff.tag.value.js +16 -16
- package/build/const/tiff.tag.value.js.map +1 -0
- package/build/const/tiff.version.d.ts +0 -1
- package/build/const/tiff.version.js +1 -1
- package/build/const/tiff.version.js.map +1 -0
- package/build/index.d.ts +11 -6
- package/build/index.js +9 -5
- package/build/index.js.map +1 -0
- package/build/read/data.view.offset.d.ts +15 -0
- package/build/read/data.view.offset.js +19 -0
- package/build/read/data.view.offset.js.map +1 -0
- package/build/read/tiff.gdal.d.ts +9 -12
- package/build/read/tiff.gdal.js +22 -17
- package/build/read/tiff.gdal.js.map +1 -0
- package/build/read/tiff.ifd.config.d.ts +6 -4
- package/build/read/tiff.ifd.config.js +2 -2
- package/build/read/tiff.ifd.config.js.map +1 -0
- package/build/read/tiff.tag.d.ts +37 -20
- package/build/read/tiff.tag.factory.d.ts +16 -0
- package/build/read/tiff.tag.factory.js +130 -0
- package/build/read/tiff.tag.factory.js.map +1 -0
- package/build/read/tiff.tag.js +2 -37
- package/build/read/tiff.tag.js.map +1 -0
- package/build/read/tiff.value.reader.d.ts +2 -6
- package/build/read/tiff.value.reader.js +16 -54
- package/build/read/tiff.value.reader.js.map +1 -0
- package/build/source.d.ts +5 -0
- package/build/source.js +2 -0
- package/build/source.js.map +1 -0
- package/build/util/bytes.d.ts +17 -0
- package/build/util/bytes.js +42 -0
- package/build/util/bytes.js.map +1 -0
- package/build/util/util.hex.d.ts +2 -3
- package/build/util/util.hex.js +4 -5
- package/build/util/util.hex.js.map +1 -0
- package/build/vector.d.ts +0 -1
- package/build/vector.js +1 -1
- package/build/vector.js.map +1 -0
- package/package.json +25 -30
- package/src/__benchmark__/cog.read.benchmark.ts +12 -10
- package/src/__benchmark__/source.file.ts +23 -0
- package/src/__benchmark__/source.memory.ts +23 -0
- package/src/__test__/cog.image.test.ts +188 -197
- package/src/__test__/cog.read.test.ts +50 -72
- package/src/__test__/example.ts +31 -0
- package/src/cog.tiff.image.ts +456 -448
- package/src/cog.tiff.ts +143 -146
- package/src/const/index.ts +1 -1
- package/src/const/tiff.endian.ts +2 -2
- package/src/const/tiff.mime.ts +21 -21
- package/src/const/tiff.tag.id.ts +159 -158
- package/src/const/tiff.tag.value.ts +16 -16
- package/src/const/tiff.version.ts +11 -11
- package/src/index.ts +11 -5
- package/src/read/data.view.offset.ts +23 -0
- package/src/read/tiff.gdal.ts +61 -63
- package/src/read/tiff.ifd.config.ts +35 -31
- package/src/read/tiff.tag.factory.ts +163 -0
- package/src/read/tiff.tag.ts +38 -39
- package/src/read/tiff.value.reader.ts +25 -73
- package/src/source.ts +5 -0
- package/src/util/bytes.ts +44 -0
- package/src/util/util.hex.ts +5 -7
- package/src/vector.ts +5 -5
- package/tsconfig.json +8 -10
- package/build/__benchmark__/cog.read.benchmark.d.ts.map +0 -1
- package/build/__test__/cog.image.test.d.ts.map +0 -1
- package/build/__test__/cog.read.test.d.ts.map +0 -1
- package/build/cog.tiff.d.ts.map +0 -1
- package/build/cog.tiff.image.d.ts.map +0 -1
- package/build/const/index.d.ts.map +0 -1
- package/build/const/tiff.endian.d.ts.map +0 -1
- package/build/const/tiff.mime.d.ts.map +0 -1
- package/build/const/tiff.tag.id.d.ts.map +0 -1
- package/build/const/tiff.tag.value.d.ts.map +0 -1
- package/build/const/tiff.version.d.ts.map +0 -1
- package/build/index.d.ts.map +0 -1
- package/build/read/tag/__test__/tag.test.d.ts +0 -2
- package/build/read/tag/__test__/tag.test.d.ts.map +0 -1
- package/build/read/tag/__test__/tag.test.js +0 -23
- package/build/read/tag/tiff.tag.base.d.ts +0 -55
- package/build/read/tag/tiff.tag.base.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.base.js +0 -79
- package/build/read/tag/tiff.tag.lazy.d.ts +0 -7
- package/build/read/tag/tiff.tag.lazy.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.lazy.js +0 -18
- package/build/read/tag/tiff.tag.offset.d.ts +0 -21
- package/build/read/tag/tiff.tag.offset.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.offset.js +0 -54
- package/build/read/tag/tiff.tag.static.d.ts +0 -8
- package/build/read/tag/tiff.tag.static.d.ts.map +0 -1
- package/build/read/tag/tiff.tag.static.js +0 -17
- package/build/read/tiff.gdal.d.ts.map +0 -1
- package/build/read/tiff.ifd.config.d.ts.map +0 -1
- package/build/read/tiff.tag.d.ts.map +0 -1
- package/build/read/tiff.value.reader.d.ts.map +0 -1
- package/build/source/cog.source.view.d.ts +0 -33
- package/build/source/cog.source.view.d.ts.map +0 -1
- package/build/source/cog.source.view.js +0 -65
- package/build/util/util.hex.d.ts.map +0 -1
- package/build/vector.d.ts.map +0 -1
- package/src/@types/ieee754.d.ts +0 -18
- package/src/read/tag/__test__/tag.test.ts +0 -27
- package/src/read/tag/tiff.tag.base.ts +0 -126
- package/src/read/tag/tiff.tag.lazy.ts +0 -17
- package/src/read/tag/tiff.tag.offset.ts +0 -61
- package/src/read/tag/tiff.tag.static.ts +0 -15
- package/src/source/cog.source.view.ts +0 -77
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { CogTiff } from './cog.tiff.js';
|
|
2
2
|
import { TiffMimeType } from './const/tiff.mime.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { CogTiffTagOffset } from './read/tag/tiff.tag.offset.js';
|
|
3
|
+
import { TagId, TagGeoId } from './const/tiff.tag.id.js';
|
|
4
|
+
import { Tag, TagOffset } from './read/tiff.tag.js';
|
|
6
5
|
import { BoundingBox, Size } from './vector.js';
|
|
7
|
-
/** Invalid EPSG code */
|
|
8
6
|
export declare const InvalidProjectionCode = 32767;
|
|
9
7
|
/**
|
|
10
8
|
* Number of tiles used inside this image
|
|
@@ -15,6 +13,8 @@ export interface CogTiffImageTiledCount {
|
|
|
15
13
|
/** Number of tiles on the y axis */
|
|
16
14
|
y: number;
|
|
17
15
|
}
|
|
16
|
+
/** Tags that are commonly accessed for geotiffs */
|
|
17
|
+
export declare const ImportantTags: Set<TagId>;
|
|
18
18
|
/**
|
|
19
19
|
* Size of a individual tile
|
|
20
20
|
*/
|
|
@@ -26,15 +26,15 @@ export interface CogTiffImageTileSize {
|
|
|
26
26
|
}
|
|
27
27
|
export declare class CogTiffImage {
|
|
28
28
|
/** All IFD tags that have been read for the image */
|
|
29
|
-
tags: Map<
|
|
29
|
+
tags: Map<TagId, Tag>;
|
|
30
30
|
/** Id of the tif image, generally the image index inside the tif */
|
|
31
31
|
id: number;
|
|
32
|
-
|
|
32
|
+
tiff: CogTiff;
|
|
33
33
|
/** Has loadGeoTiffTags been called */
|
|
34
|
-
|
|
34
|
+
isGeoTagsLoaded: boolean;
|
|
35
35
|
/** Sub tags stored in TiffTag.GeoKeyDirectory */
|
|
36
|
-
tagsGeo: Map<
|
|
37
|
-
constructor(
|
|
36
|
+
tagsGeo: Map<TagGeoId, string | number>;
|
|
37
|
+
constructor(tiff: CogTiff, id: number, tags: Map<TagId, Tag>);
|
|
38
38
|
/**
|
|
39
39
|
* Force loading of important tags if they have not already been loaded
|
|
40
40
|
*
|
|
@@ -44,7 +44,7 @@ export declare class CogTiffImage {
|
|
|
44
44
|
/**
|
|
45
45
|
* Get the value of a TiffTag if it exists null otherwise
|
|
46
46
|
*/
|
|
47
|
-
value<T>(tag:
|
|
47
|
+
value<T>(tag: TagId): T | null;
|
|
48
48
|
/**
|
|
49
49
|
* Load and unpack the GeoKeyDirectory
|
|
50
50
|
*/
|
|
@@ -52,12 +52,12 @@ export declare class CogTiffImage {
|
|
|
52
52
|
/**
|
|
53
53
|
* Get the associated GeoTiffTags
|
|
54
54
|
*/
|
|
55
|
-
valueGeo(tag:
|
|
55
|
+
valueGeo(tag: TagGeoId): string | number | undefined;
|
|
56
56
|
/**
|
|
57
57
|
* Load a tag, if it is not currently loaded, fetch the required data for the tag.
|
|
58
58
|
* @param tag tag to fetch
|
|
59
59
|
*/
|
|
60
|
-
fetch<T>(tag:
|
|
60
|
+
fetch<T>(tag: TagId): Promise<T | null>;
|
|
61
61
|
/**
|
|
62
62
|
* Get the origin point for the image
|
|
63
63
|
*
|
|
@@ -98,10 +98,6 @@ export declare class CogTiffImage {
|
|
|
98
98
|
* @returns Size in pixels
|
|
99
99
|
*/
|
|
100
100
|
get size(): Size;
|
|
101
|
-
/**
|
|
102
|
-
* Get the list of IFD tags that were read
|
|
103
|
-
*/
|
|
104
|
-
get tagList(): string[];
|
|
105
101
|
/**
|
|
106
102
|
* Determine if this image is tiled
|
|
107
103
|
*/
|
|
@@ -121,7 +117,7 @@ export declare class CogTiffImage {
|
|
|
121
117
|
*
|
|
122
118
|
* @returns file offset to where the tiffs are stored
|
|
123
119
|
*/
|
|
124
|
-
get tileOffset():
|
|
120
|
+
get tileOffset(): TagOffset;
|
|
125
121
|
/**
|
|
126
122
|
* Get the number of strip's inside this tiff
|
|
127
123
|
*
|
|
@@ -130,13 +126,6 @@ export declare class CogTiffImage {
|
|
|
130
126
|
* @returns number of strips present
|
|
131
127
|
*/
|
|
132
128
|
get stripCount(): number;
|
|
133
|
-
/**
|
|
134
|
-
* Get a pointer to a specific tile inside the tiff file
|
|
135
|
-
*
|
|
136
|
-
* @param index tile index
|
|
137
|
-
* @returns file offset of the specified tile
|
|
138
|
-
*/
|
|
139
|
-
protected getTileOffset(index: number): Promise<number>;
|
|
140
129
|
getTileBounds(x: number, y: number): BoundingBox;
|
|
141
130
|
/**
|
|
142
131
|
* Read a strip into a uint8 array
|
|
@@ -145,7 +134,7 @@ export declare class CogTiffImage {
|
|
|
145
134
|
*/
|
|
146
135
|
getStrip(index: number): Promise<{
|
|
147
136
|
mimeType: TiffMimeType;
|
|
148
|
-
bytes:
|
|
137
|
+
bytes: ArrayBuffer;
|
|
149
138
|
} | null>;
|
|
150
139
|
/** The jpeg header is stored in the IFD, read the JPEG header and adjust the byte array to include it */
|
|
151
140
|
private getJpegHeader;
|
|
@@ -161,7 +150,7 @@ export declare class CogTiffImage {
|
|
|
161
150
|
*/
|
|
162
151
|
getTile(x: number, y: number): Promise<{
|
|
163
152
|
mimeType: TiffMimeType;
|
|
164
|
-
bytes:
|
|
153
|
+
bytes: ArrayBuffer;
|
|
165
154
|
} | null>;
|
|
166
155
|
/**
|
|
167
156
|
* Does this tile exist in the tiff and does it actually have a value
|
|
@@ -173,9 +162,8 @@ export declare class CogTiffImage {
|
|
|
173
162
|
* @returns if the tile exists and has data
|
|
174
163
|
*/
|
|
175
164
|
hasTile(x: number, y: number): Promise<boolean>;
|
|
176
|
-
|
|
165
|
+
getTileSize(index: number): Promise<{
|
|
177
166
|
offset: number;
|
|
178
167
|
imageSize: number;
|
|
179
168
|
}>;
|
|
180
169
|
}
|
|
181
|
-
//# sourceMappingURL=cog.tiff.image.d.ts.map
|