@cogeotiff/core 7.2.1 → 8.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.
Files changed (147) hide show
  1. package/CHANGELOG.md +5 -502
  2. package/README.md +23 -11
  3. package/build/__benchmark__/cog.read.benchmark.d.ts +0 -1
  4. package/build/__benchmark__/cog.read.benchmark.js +6 -4
  5. package/build/__benchmark__/cog.read.benchmark.js.map +1 -0
  6. package/build/__benchmark__/source.file.d.ts +9 -0
  7. package/build/__benchmark__/source.file.js +29 -0
  8. package/build/__benchmark__/source.file.js.map +1 -0
  9. package/build/__benchmark__/source.memory.d.ts +9 -0
  10. package/build/__benchmark__/source.memory.js +32 -0
  11. package/build/__benchmark__/source.memory.js.map +1 -0
  12. package/build/__test__/cog.image.test.d.ts +1 -2
  13. package/build/__test__/cog.image.test.js +82 -90
  14. package/build/__test__/cog.image.test.js.map +1 -0
  15. package/build/__test__/cog.read.test.d.ts +1 -2
  16. package/build/__test__/cog.read.test.js +37 -55
  17. package/build/__test__/cog.read.test.js.map +1 -0
  18. package/build/__test__/example.d.ts +1 -0
  19. package/build/__test__/example.js +27 -0
  20. package/build/__test__/example.js.map +1 -0
  21. package/build/cog.tiff.d.ts +22 -28
  22. package/build/cog.tiff.image.d.ts +11 -23
  23. package/build/cog.tiff.image.js +108 -62
  24. package/build/cog.tiff.image.js.map +1 -0
  25. package/build/cog.tiff.js +141 -97
  26. package/build/cog.tiff.js.map +1 -0
  27. package/build/const/index.d.ts +1 -2
  28. package/build/const/index.js +2 -2
  29. package/build/const/index.js.map +1 -0
  30. package/build/const/tiff.endian.d.ts +0 -1
  31. package/build/const/tiff.endian.js +1 -1
  32. package/build/const/tiff.endian.js.map +1 -0
  33. package/build/const/tiff.mime.d.ts +10 -11
  34. package/build/const/tiff.mime.js +22 -22
  35. package/build/const/tiff.mime.js.map +1 -0
  36. package/build/const/tiff.tag.id.d.ts +3 -3
  37. package/build/const/tiff.tag.id.js +4 -3
  38. package/build/const/tiff.tag.id.js.map +1 -0
  39. package/build/const/tiff.tag.value.d.ts +15 -16
  40. package/build/const/tiff.tag.value.js +16 -16
  41. package/build/const/tiff.tag.value.js.map +1 -0
  42. package/build/const/tiff.version.d.ts +0 -1
  43. package/build/const/tiff.version.js +1 -1
  44. package/build/const/tiff.version.js.map +1 -0
  45. package/build/index.d.ts +11 -6
  46. package/build/index.js +9 -5
  47. package/build/index.js.map +1 -0
  48. package/build/read/data.view.offset.d.ts +15 -0
  49. package/build/read/data.view.offset.js +19 -0
  50. package/build/read/data.view.offset.js.map +1 -0
  51. package/build/read/tiff.gdal.d.ts +9 -12
  52. package/build/read/tiff.gdal.js +22 -17
  53. package/build/read/tiff.gdal.js.map +1 -0
  54. package/build/read/tiff.ifd.config.d.ts +6 -4
  55. package/build/read/tiff.ifd.config.js +2 -2
  56. package/build/read/tiff.ifd.config.js.map +1 -0
  57. package/build/read/tiff.tag.d.ts +40 -20
  58. package/build/read/tiff.tag.factory.d.ts +16 -0
  59. package/build/read/tiff.tag.factory.js +130 -0
  60. package/build/read/tiff.tag.factory.js.map +1 -0
  61. package/build/read/tiff.tag.js +2 -37
  62. package/build/read/tiff.tag.js.map +1 -0
  63. package/build/read/tiff.value.reader.d.ts +2 -6
  64. package/build/read/tiff.value.reader.js +16 -54
  65. package/build/read/tiff.value.reader.js.map +1 -0
  66. package/build/source.d.ts +5 -0
  67. package/build/source.js +2 -0
  68. package/build/source.js.map +1 -0
  69. package/build/util/bytes.d.ts +17 -0
  70. package/build/util/bytes.js +42 -0
  71. package/build/util/bytes.js.map +1 -0
  72. package/build/util/util.hex.d.ts +2 -3
  73. package/build/util/util.hex.js +4 -5
  74. package/build/util/util.hex.js.map +1 -0
  75. package/build/vector.d.ts +0 -1
  76. package/build/vector.js +1 -1
  77. package/build/vector.js.map +1 -0
  78. package/package.json +25 -30
  79. package/src/__benchmark__/cog.read.benchmark.ts +12 -10
  80. package/src/__benchmark__/source.file.ts +23 -0
  81. package/src/__benchmark__/source.memory.ts +23 -0
  82. package/src/__test__/cog.image.test.ts +188 -197
  83. package/src/__test__/cog.read.test.ts +50 -72
  84. package/src/__test__/example.ts +31 -0
  85. package/src/cog.tiff.image.ts +456 -447
  86. package/src/cog.tiff.ts +142 -145
  87. package/src/const/index.ts +1 -1
  88. package/src/const/tiff.endian.ts +2 -2
  89. package/src/const/tiff.mime.ts +21 -21
  90. package/src/const/tiff.tag.id.ts +157 -156
  91. package/src/const/tiff.tag.value.ts +16 -16
  92. package/src/const/tiff.version.ts +11 -11
  93. package/src/index.ts +11 -5
  94. package/src/read/data.view.offset.ts +23 -0
  95. package/src/read/tiff.gdal.ts +61 -63
  96. package/src/read/tiff.ifd.config.ts +35 -31
  97. package/src/read/tiff.tag.factory.ts +163 -0
  98. package/src/read/tiff.tag.ts +40 -38
  99. package/src/read/tiff.value.reader.ts +25 -73
  100. package/src/source.ts +5 -0
  101. package/src/util/bytes.ts +44 -0
  102. package/src/util/util.hex.ts +5 -7
  103. package/src/vector.ts +5 -5
  104. package/tsconfig.json +8 -8
  105. package/build/__benchmark__/cog.read.benchmark.d.ts.map +0 -1
  106. package/build/__test__/cog.image.test.d.ts.map +0 -1
  107. package/build/__test__/cog.read.test.d.ts.map +0 -1
  108. package/build/cog.tiff.d.ts.map +0 -1
  109. package/build/cog.tiff.image.d.ts.map +0 -1
  110. package/build/const/index.d.ts.map +0 -1
  111. package/build/const/tiff.endian.d.ts.map +0 -1
  112. package/build/const/tiff.mime.d.ts.map +0 -1
  113. package/build/const/tiff.tag.id.d.ts.map +0 -1
  114. package/build/const/tiff.tag.value.d.ts.map +0 -1
  115. package/build/const/tiff.version.d.ts.map +0 -1
  116. package/build/index.d.ts.map +0 -1
  117. package/build/read/tag/__test__/tag.test.d.ts +0 -2
  118. package/build/read/tag/__test__/tag.test.d.ts.map +0 -1
  119. package/build/read/tag/__test__/tag.test.js +0 -23
  120. package/build/read/tag/tiff.tag.base.d.ts +0 -55
  121. package/build/read/tag/tiff.tag.base.d.ts.map +0 -1
  122. package/build/read/tag/tiff.tag.base.js +0 -79
  123. package/build/read/tag/tiff.tag.lazy.d.ts +0 -7
  124. package/build/read/tag/tiff.tag.lazy.d.ts.map +0 -1
  125. package/build/read/tag/tiff.tag.lazy.js +0 -18
  126. package/build/read/tag/tiff.tag.offset.d.ts +0 -21
  127. package/build/read/tag/tiff.tag.offset.d.ts.map +0 -1
  128. package/build/read/tag/tiff.tag.offset.js +0 -54
  129. package/build/read/tag/tiff.tag.static.d.ts +0 -8
  130. package/build/read/tag/tiff.tag.static.d.ts.map +0 -1
  131. package/build/read/tag/tiff.tag.static.js +0 -17
  132. package/build/read/tiff.gdal.d.ts.map +0 -1
  133. package/build/read/tiff.ifd.config.d.ts.map +0 -1
  134. package/build/read/tiff.tag.d.ts.map +0 -1
  135. package/build/read/tiff.value.reader.d.ts.map +0 -1
  136. package/build/source/cog.source.view.d.ts +0 -33
  137. package/build/source/cog.source.view.d.ts.map +0 -1
  138. package/build/source/cog.source.view.js +0 -65
  139. package/build/util/util.hex.d.ts.map +0 -1
  140. package/build/vector.d.ts.map +0 -1
  141. package/src/@types/ieee754.d.ts +0 -18
  142. package/src/read/tag/__test__/tag.test.ts +0 -27
  143. package/src/read/tag/tiff.tag.base.ts +0 -126
  144. package/src/read/tag/tiff.tag.lazy.ts +0 -17
  145. package/src/read/tag/tiff.tag.offset.ts +0 -61
  146. package/src/read/tag/tiff.tag.static.ts +0 -15
  147. package/src/source/cog.source.view.ts +0 -77
package/CHANGELOG.md CHANGED
@@ -1,512 +1,15 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [7.2.0](https://github.com/blacha/cogeotiff/compare/v7.1.0...v7.2.0) (2022-08-23)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * **core:** sometimes MASK_INTERLEAVED_WITH_IMAGERY is prefixed with a space so trim it ([5002e22](https://github.com/blacha/cogeotiff/commit/5002e22bdd0a6480d210d89ce6878b3e4df0efd9))
12
-
13
-
14
- ### Features
15
-
16
- * **core:** add zstd compression ([c9f9c4c](https://github.com/blacha/cogeotiff/commit/c9f9c4cf342a7e72657ee2481e600273c0e166c5))
17
- * **core:** import LERC, LZMA and JpegXL compression types ([49af971](https://github.com/blacha/cogeotiff/commit/49af9716f0400643be2085a933d2db2b8a988226))
18
-
19
-
20
-
21
-
22
-
23
- # [7.1.0](https://github.com/blacha/cogeotiff/compare/v7.0.0...v7.1.0) (2022-06-22)
24
-
25
-
26
- ### Bug Fixes
27
-
28
- * **core:** load the ghost header bytes if requested ([b1f0116](https://github.com/blacha/cogeotiff/commit/b1f01164da1ad7deed7c3754e0106ccfea773338))
29
-
30
-
31
- ### Features
32
-
33
- * **core:** add hasTile function to determine if a tile exists in a sparse tiff ([e56a67c](https://github.com/blacha/cogeotiff/commit/e56a67cc078945c5d96ddd3e6aefbf2d773359a4))
34
-
35
-
36
- ### Performance Improvements
37
-
38
- * **core:** improve parsing of ghost options ([ffa7928](https://github.com/blacha/cogeotiff/commit/ffa79283a61efd6f9999bd43d222faa24cd5ced7))
39
- * greatly increase the amount of tiles being read so nodejs startup time affects the timing less ([3e9c0f3](https://github.com/blacha/cogeotiff/commit/3e9c0f305584d95fd79e1fe094477f3589b235c6))
40
- * **core:** improve lookup speed of ghost options ([7c5f37e](https://github.com/blacha/cogeotiff/commit/7c5f37e114a77a772ca588e62b6d22712d05b2bc))
41
-
42
-
43
-
44
-
45
-
46
- # [7.0.0](https://github.com/blacha/cogeotiff/compare/v6.1.1...v7.0.0) (2022-03-17)
47
-
48
-
49
- ### Features
50
-
51
- * **core:** upgrade chunkd and remove logger for internal fetches ([#832](https://github.com/blacha/cogeotiff/issues/832)) ([71bd740](https://github.com/blacha/cogeotiff/commit/71bd7409706e4a82e6a29b2a3fc0e8b25221e9fc))
52
-
53
-
54
-
55
-
56
-
57
- ## [7.2.1](https://github.com/blacha/cogeotiff/compare/core-v7.2.0...core-v7.2.1) (2022-11-16)
58
-
59
-
60
- ### Bug Fixes
61
-
62
- * **core:** better examples ([bb9fda1](https://github.com/blacha/cogeotiff/commit/bb9fda10a614dfd37e272b48d4f5291d1b2c9542))
63
-
64
- ## [6.1.1](https://github.com/blacha/cogeotiff/compare/v6.1.0...v6.1.1) (2022-01-26)
65
-
66
-
67
- ### Bug Fixes
68
-
69
- * **core:** tag data count should be a uint32 for tiff not uint16 ([5e0f66c](https://github.com/blacha/cogeotiff/commit/5e0f66c213db265d83d976424b6a443be6afbe73))
70
-
71
-
72
-
73
-
74
-
75
- # [6.1.0](https://github.com/blacha/cogeotiff/compare/v6.0.2...v6.1.0) (2021-09-30)
76
-
77
-
78
- ### Features
79
-
80
- * **core:** support no compression ([f1f8762](https://github.com/blacha/cogeotiff/commit/f1f8762d6b5a4b2b8eae7f472bd70f0216138be8))
81
-
82
-
83
-
84
-
85
-
86
- ## [6.0.2](https://github.com/blacha/cogeotiff/compare/v6.0.1...v6.0.2) (2021-09-16)
87
-
88
-
89
- ### Bug Fixes
90
-
91
- * upgrade to latest chunkd fixes issue with missing fetchBytes function ([9b33cbf](https://github.com/blacha/cogeotiff/commit/9b33cbfe02acaa1248895203c1a55002b82d1a49))
92
-
93
-
94
-
95
-
96
-
97
- ## [6.0.1](https://github.com/blacha/cogeotiff/compare/v6.0.0...v6.0.1) (2021-09-15)
98
-
99
- **Note:** Version bump only for package @cogeotiff/core
100
-
101
-
102
-
103
-
104
-
105
- # [6.0.0](https://github.com/blacha/cogeotiff/compare/v5.0.0...v6.0.0) (2021-09-11)
106
-
107
-
108
- ### Features
109
-
110
- * package with esm modules ([#738](https://github.com/blacha/cogeotiff/issues/738)) ([ac0b4f0](https://github.com/blacha/cogeotiff/commit/ac0b4f0932538a55ccc2d22bba94b8bf23dba27a))
111
-
112
-
113
- ### BREAKING CHANGES
114
-
115
- * this changes the module system to ESM which breaks compatibility with require
116
-
117
-
118
-
119
-
120
-
121
- # [5.0.0](https://github.com/blacha/cogeotiff/compare/v4.4.0...v5.0.0) (2021-07-23)
122
-
123
-
124
- ### Features
125
-
126
- * extract all chunk source logic into `@chunkd/*` ([#723](https://github.com/blacha/cogeotiff/issues/723)) ([fa42393](https://github.com/blacha/cogeotiff/commit/fa4239358b11821b21fc78652b0744bc3c839c06))
127
-
128
-
129
-
130
-
131
-
132
- # [4.3.0](https://github.com/blacha/cogeotiff/compare/v4.2.0...v4.3.0) (2021-06-22)
133
-
134
-
135
- ### Features
136
-
137
- * **chunk:** expose a in memory chunk reader ([a550682](https://github.com/blacha/cogeotiff/commit/a5506820569d8e56f1a28648b78d86aa61d7e453))
138
-
139
-
140
-
141
-
142
-
143
- # [4.2.0](https://github.com/blacha/cogeotiff/compare/v4.1.2...v4.2.0) (2021-03-25)
144
-
145
-
146
- ### Features
147
-
148
- * **chunk:** add ability to read entire file using .read() ([#664](https://github.com/blacha/cogeotiff/issues/664)) ([4db04ad](https://github.com/blacha/cogeotiff/commit/4db04adc43ab4c358526e469c712f7958381d738))
149
-
150
-
151
-
152
-
153
-
154
- ## [4.1.2](https://github.com/blacha/cogeotiff/compare/v4.1.1...v4.1.2) (2021-03-18)
155
-
156
-
157
- ### Bug Fixes
158
-
159
- * **core:** lazy tags should cache the lazy value ([a30c0e1](https://github.com/blacha/cogeotiff/commit/a30c0e1b976cdf4956b2d962d1cfafdf0f74dce0))
160
- * **core:** load additional bytes for ifdReading if needed ([d59bf2d](https://github.com/blacha/cogeotiff/commit/d59bf2d383d8748ba13dabd8915ea11bcb46adeb))
161
-
162
-
163
-
164
-
165
-
166
- ## [4.1.1](https://github.com/blacha/cogeotiff/compare/v4.1.0...v4.1.1) (2021-03-10)
167
-
168
-
169
- ### Bug Fixes
170
-
171
- * **core:** actually fetch bytes when needed by a lazy tag loader ([0cb8e50](https://github.com/blacha/cogeotiff/commit/0cb8e5074d6753809c00def18dd6d900923b9085))
172
-
173
-
174
-
175
-
176
-
177
- # [4.1.0](https://github.com/blacha/cogeotiff/compare/v4.0.0...v4.1.0) (2021-02-23)
178
-
179
-
180
- ### Features
181
-
182
- * **core:** allow CogTiff.init to be called multiple times ([4a8ab20](https://github.com/blacha/cogeotiff/commit/4a8ab20946bb72121d080300c42404933d42fe06))
183
- * **web:** support rendering in leaflet maps ([#482](https://github.com/blacha/cogeotiff/issues/482)) ([dfb40fa](https://github.com/blacha/cogeotiff/commit/dfb40fad836d4e762bd2485a435ac402fcf1c3d6))
184
-
185
-
186
-
187
-
188
-
189
- # [4.0.0](https://github.com/blacha/cogeotiff/compare/v3.1.0...v4.0.0) (2021-02-02)
190
-
191
- **Note:** Version bump only for package @cogeotiff/core
192
-
193
-
194
-
195
-
196
-
197
- # [3.1.0](https://github.com/blacha/coginfo/compare/v3.0.0...v3.1.0) (2021-01-18)
198
-
199
-
200
- ### Features
201
-
202
- * **cli:** support cogs that are not geolocated ([#632](https://github.com/blacha/coginfo/issues/632)) ([da73964](https://github.com/blacha/coginfo/commit/da73964944620dd32094eab14e475225de021857))
203
-
204
-
205
-
206
-
207
-
208
- # [3.0.0](https://github.com/blacha/coginfo/compare/v2.2.0...v3.0.0) (2020-10-30)
209
-
210
- **Note:** Version bump only for package @cogeotiff/core
211
-
212
-
213
-
214
-
215
-
216
- # [2.2.0](https://github.com/blacha/coginfo/compare/v2.1.1...v2.2.0) (2020-07-01)
217
-
218
-
219
- ### Features
220
-
221
- * adding uri for a full reference for any source ([#469](https://github.com/blacha/coginfo/issues/469)) ([137d9c9](https://github.com/blacha/coginfo/commit/137d9c9))
222
-
223
-
224
-
225
-
226
-
227
- ## [2.1.1](https://github.com/blacha/coginfo/compare/v2.1.0...v2.1.1) (2020-06-25)
228
-
229
-
230
- ### Bug Fixes
231
-
232
- * **core:** sparse cogs should return null for sparse tiles ([#466](https://github.com/blacha/coginfo/issues/466)) ([322c4d1](https://github.com/blacha/coginfo/commit/322c4d1))
233
-
234
-
235
-
236
-
237
-
238
- # [2.1.0](https://github.com/blacha/coginfo/compare/v2.0.0...v2.1.0) (2020-06-14)
239
-
240
-
241
- ### Features
242
-
243
- * **cog:** allow file sources to be closed if they need to be ([#430](https://github.com/blacha/coginfo/issues/430)) ([d2441e0](https://github.com/blacha/coginfo/commit/d2441e0))
244
- * **core:** expose epsg information ([54ab940](https://github.com/blacha/coginfo/commit/54ab940))
245
- * **core:** support striped tiffs ([#435](https://github.com/blacha/coginfo/issues/435)) ([8a5d68e](https://github.com/blacha/coginfo/commit/8a5d68e))
246
-
247
-
248
-
249
-
250
-
251
- # [2.0.0](https://github.com/blacha/coginfo/compare/v1.1.0...v2.0.0) (2020-05-18)
252
-
253
-
254
- * feat!: better support for sparse tiffs (#407) ([869073a](https://github.com/blacha/coginfo/commit/869073a)), closes [#407](https://github.com/blacha/coginfo/issues/407)
255
-
256
-
257
- ### BREAKING CHANGES
258
-
259
- * getTile now may return null if there is no data for a tile
260
-
261
- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
262
-
263
-
264
-
265
-
266
-
267
- ## [1.0.8](https://github.com/blacha/coginfo/compare/v1.0.7...v1.0.8) (2020-05-11)
268
-
269
-
270
- ### Bug Fixes
271
-
272
- * **core:** do no read too many bytes from the file ([#388](https://github.com/blacha/coginfo/issues/388)) ([e745249](https://github.com/blacha/coginfo/commit/e745249))
273
-
274
-
275
-
276
-
277
-
278
- ## [1.0.7](https://github.com/blacha/coginfo/compare/v1.0.6...v1.0.7) (2020-05-10)
279
-
280
-
281
- ### Bug Fixes
282
-
283
- * **cli:** dump tiles sometimes failed with "Chunk is not ready" ([#386](https://github.com/blacha/coginfo/issues/386)) ([890ef22](https://github.com/blacha/coginfo/commit/890ef22))
284
-
285
-
286
-
287
-
288
-
289
- ## [1.0.6](https://github.com/blacha/coginfo/compare/v1.0.5...v1.0.6) (2020-05-07)
290
-
291
- **Note:** Version bump only for package @cogeotiff/core
292
-
293
-
294
-
295
-
296
-
297
- ## [1.0.5](https://github.com/blacha/coginfo/compare/v1.0.4...v1.0.5) (2020-05-07)
3
+ ## [8.0.2](https://github.com/blacha/cogeotiff/compare/core-v8.0.1...core-v8.0.2) (2023-08-05)
298
4
 
299
5
 
300
6
  ### Bug Fixes
301
7
 
302
- * allow CogTiff.init() to be called multiple times ([#382](https://github.com/blacha/coginfo/issues/382)) ([f282f9e](https://github.com/blacha/coginfo/commit/f282f9e))
303
-
304
-
8
+ * **core:** expose TiffTag and TiffTagGeo ([d538bdc](https://github.com/blacha/cogeotiff/commit/d538bdc833bf76ba8d730a1062156916715585b4))
305
9
 
306
-
307
-
308
- ## [1.0.4](https://github.com/blacha/coginfo/compare/v1.0.3...v1.0.4) (2020-04-29)
10
+ ## [8.0.1](https://github.com/blacha/cogeotiff/compare/core-v8.0.0...core-v8.0.1) (2023-08-05)
309
11
 
310
12
 
311
13
  ### Bug Fixes
312
14
 
313
- * **cli:** zoom has no correlation to any real world zoom ([#373](https://github.com/blacha/coginfo/issues/373)) ([dfccc3e](https://github.com/blacha/coginfo/commit/dfccc3e))
314
-
315
-
316
-
317
-
318
-
319
- ## [1.0.3](https://github.com/blacha/coginfo/compare/v1.0.2...v1.0.3) (2020-03-12)
320
-
321
- **Note:** Version bump only for package @cogeotiff/core
322
-
323
-
324
-
325
-
326
-
327
- ## [1.0.2](https://github.com/blacha/coginfo/compare/v1.0.1...v1.0.2) (2020-03-12)
328
-
329
- **Note:** Version bump only for package @cogeotiff/core
330
-
331
-
332
-
333
-
334
-
335
- ## [1.0.1](https://github.com/blacha/coginfo/compare/v1.0.0...v1.0.1) (2020-03-10)
336
-
337
-
338
- ### Bug Fixes
339
-
340
- * Offset is outside the bounds of the DataView ([3cc8e5b](https://github.com/blacha/coginfo/commit/3cc8e5b))
341
-
342
-
343
-
344
-
345
-
346
- # [1.0.0](https://github.com/blacha/coginfo/compare/v0.9.1...v1.0.0) (2020-03-09)
347
-
348
-
349
- * feat!: load geotags from other tiff tags ([a34f323](https://github.com/blacha/coginfo/commit/a34f323))
350
-
351
-
352
- ### Features
353
-
354
- * show more information about tiff tags when requested ([d13ea48](https://github.com/blacha/coginfo/commit/d13ea48))
355
-
356
-
357
- ### BREAKING CHANGES
358
-
359
- * this forces a async load to be called before geo tags can be accessed
360
-
361
-
362
-
363
-
364
-
365
- # [0.9.0](https://github.com/blacha/coginfo/compare/v0.8.0...v0.9.0) (2020-01-16)
366
-
367
-
368
- ### Bug Fixes
369
-
370
- * correctly reject excpetions thrown inside of a fetch ([ab8fe9a](https://github.com/blacha/coginfo/commit/ab8fe9a))
371
-
372
-
373
- ### Features
374
-
375
- * allow the cli to load geotiffs from s3 ([8db14c9](https://github.com/blacha/coginfo/commit/8db14c9))
376
-
377
-
378
-
379
-
380
-
381
- # [0.8.0](https://github.com/blacha/coginfo/compare/v0.7.0...v0.8.0) (2020-01-16)
382
-
383
- **Note:** Version bump only for package @cogeotiff/core
384
-
385
-
386
-
387
-
388
-
389
- # [0.7.0](https://github.com/blacha/coginfo/compare/v0.6.0...v0.7.0) (2019-12-08)
390
-
391
- **Note:** Version bump only for package @cogeotiff/core
392
-
393
-
394
-
395
-
396
-
397
- # [0.6.0](https://github.com/blacha/coginfo/compare/v0.5.0...v0.6.0) (2019-11-22)
398
-
399
-
400
- ### Features
401
-
402
- * parse geokeys to get projections ([2b2dcf6](https://github.com/blacha/coginfo/commit/2b2dcf6))
403
-
404
-
405
-
406
-
407
-
408
- # [0.5.0](https://github.com/blacha/coginfo/compare/v0.4.1...v0.5.0) (2019-11-21)
409
-
410
-
411
- ### Bug Fixes
412
-
413
- * force read in a few kb of data around the headers ([bf7a63a](https://github.com/blacha/coginfo/commit/bf7a63a))
414
-
415
-
416
- ### Features
417
-
418
- * typescript 3.7 ([ada8c2b](https://github.com/blacha/coginfo/commit/ada8c2b))
419
-
420
-
421
-
422
-
423
-
424
- ## [0.4.1](https://github.com/blacha/coginfo/compare/v0.4.0...v0.4.1) (2019-10-08)
425
-
426
- **Note:** Version bump only for package @cogeotiff/core
427
-
428
-
429
-
430
-
431
-
432
- # [0.4.0](https://github.com/blacha/coginfo/compare/v0.3.1...v0.4.0) (2019-10-08)
433
-
434
-
435
- ### Bug Fixes
436
-
437
- * eslint complains about log?.trace() syntax ([337224c](https://github.com/blacha/coginfo/commit/337224c))
438
- * lgtm issues ([5ccde83](https://github.com/blacha/coginfo/commit/5ccde83))
439
-
440
-
441
- ### Features
442
-
443
- * expose img.getTileBounds ([9bfd1c1](https://github.com/blacha/coginfo/commit/9bfd1c1))
444
- * lazy load more data to reduce initial read time for ifd ([74e1dc7](https://github.com/blacha/coginfo/commit/74e1dc7))
445
- * optimize reads if they are contained within one chunk ([824a629](https://github.com/blacha/coginfo/commit/824a629))
446
- * switch to typescript 3.7 to remove some costly logging ([a585195](https://github.com/blacha/coginfo/commit/a585195))
447
-
448
-
449
-
450
-
451
-
452
- ## [0.3.1](https://github.com/blacha/coginfo/compare/v0.3.0...v0.3.1) (2019-09-25)
453
-
454
- **Note:** Version bump only for package @cogeotiff/core
455
-
456
-
457
-
458
-
459
-
460
- # [0.3.0](https://github.com/blacha/coginfo/compare/v0.2.3...v0.3.0) (2019-09-24)
461
-
462
-
463
- ### Bug Fixes
464
-
465
- * guard always evaluates false ([dd9550b](https://github.com/blacha/coginfo/commit/dd9550b))
466
-
467
-
468
- ### Features
469
-
470
- * adding support for getting by resolution ([69d3a5d](https://github.com/blacha/coginfo/commit/69d3a5d))
471
- * include image size of a tile ([31aa174](https://github.com/blacha/coginfo/commit/31aa174))
472
-
473
-
474
-
475
-
476
-
477
- ## [0.2.2](https://github.com/blacha/coginfo/compare/v0.2.1...v0.2.2) (2019-09-12)
478
-
479
-
480
- ### Bug Fixes
481
-
482
- * ignore tsconfig.tsbuildinfo when publishing ([8a27600](https://github.com/blacha/coginfo/commit/8a27600))
483
-
484
-
485
-
486
-
487
-
488
- ## [0.2.1](https://github.com/blacha/coginfo/compare/v0.2.0...v0.2.1) (2019-09-12)
489
-
490
-
491
- ### Bug Fixes
492
-
493
- * cannot publish without access:public ([a408389](https://github.com/blacha/coginfo/commit/a408389))
494
-
495
-
496
-
497
-
498
-
499
- # [0.2.0](https://github.com/blacha/coginfo/compare/v0.0.12...v0.2.0) (2019-09-12)
500
-
501
-
502
- ### Bug Fixes
503
-
504
- * load required ifd tags when the image loads if they are not part of the same block as the ifd ([a6713cc](https://github.com/blacha/coginfo/commit/a6713cc))
505
- * remove cyclic dependency ([d0ab5f5](https://github.com/blacha/coginfo/commit/d0ab5f5))
506
-
507
-
508
- ### Features
509
-
510
- * rename to cogeotiff ([9a2c099](https://github.com/blacha/coginfo/commit/9a2c099))
511
- * support lzw & deflate output ([dd0f6aa](https://github.com/blacha/coginfo/commit/dd0f6aa))
512
- * support model transformation ([9af4034](https://github.com/blacha/coginfo/commit/9af4034))
15
+ * broken changelog ordering ([31f8c8a](https://github.com/blacha/cogeotiff/commit/31f8c8ac5e2770427ed2dc0f5c7c34330c6cb0eb))
package/README.md CHANGED
@@ -1,29 +1,40 @@
1
1
  # @cogeotiff/core
2
2
 
3
- Reading logic for GeoTiffs
3
+ Working with [Cloud optimized GEOTiff](https://www.cogeo.org/)
4
+
5
+ - Completely javascript based, works in the browser and nodejs
6
+ - Lazy load COG images and metadata
7
+ - Supports huge 100GB+ COGs
8
+ - Uses GDAL COG optimizations, generally only one or two reads per tile!
9
+ - Loads COGs from URL, File, Google Cloud or AWS S3
10
+ - Used in production for [LINZ's Basemaps](https://github.com/linz/basemaps) with billions of tiles fetched from COGs!
4
11
 
5
12
  ## Usage
6
13
 
14
+ Load a COG from a remote http source
15
+
7
16
  ```typescript
8
- import { CogSourceUrl } from '@chunkd/source-url';
17
+ import { SourceHttp } from '@chunkd/source-url';
18
+ import { CogTiff } from '@cogeotiff/core'
9
19
 
10
- const source = new CogSourceUrl('https://example.com/cog.tif');
11
- const tiff = await CogTiff.create(source)
20
+ const source = new SourceHttp('https://example.com/cog.tif');
21
+ const tiff = await CogTiff.create(source);
12
22
 
13
23
  /** Load a specific tile from a specific image */
14
- const tile = await cog.getTile(2, 2, 5);
24
+ const tile = await tiff.images[5].getTile(2, 2);
15
25
 
16
- /** Load the 5th image in the Tif */
17
- const img = cog.getImage(5);
26
+ /** Load the 5th image in the Tiff */
27
+ const img = tiff.images[5];
18
28
  if (img.isTiled()) {
19
29
  /** Load tile x:10 y:10 */
20
30
  const tile = await img.getTile(10, 10);
21
-
22
- const tileInfo = img.tileInfo
31
+ tile.mimeType; // image/jpeg
32
+ tile.bytes; // Raw image buffer
23
33
  }
24
34
 
25
- /** Get the origin point of the tif */
35
+ /** Get the origin point of the tiff */
26
36
  const origin = img.origin;
37
+ /** Bounding box of the tiff */
27
38
  const bbox = img.bbox;
28
39
  ```
29
40
 
@@ -31,4 +42,5 @@ const bbox = img.bbox;
31
42
  More examples can bee seen
32
43
 
33
44
  - [@cogeotiff/example](https://github.com/blacha/cogeotiff/tree/master/packages/examples)
34
- - [CogViewer](https://github.com/blacha/cogeotiff-web)
45
+ - [CogViewer](https://github.com/blacha/cogeotiff-web)
46
+ - [@chunkd](https://github.com/blacha/chunkd) Additional sources eg file:// and s3://
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=cog.read.benchmark.d.ts.map
@@ -1,18 +1,20 @@
1
- import { SourceMemory } from '@chunkd/core';
2
1
  import { readFile } from 'fs/promises';
3
2
  import { CogTiff } from '../cog.tiff.js';
3
+ import { SourceMemory } from './source.memory.js';
4
+ // console.log = console.trace;
4
5
  /** Read a tile from every image inside of a tiff 300 tiles read */
5
6
  async function main() {
6
7
  const buf = await readFile(process.argv[process.argv.length - 1]);
7
- const source = new SourceMemory('buf', buf);
8
+ const source = new SourceMemory(buf);
8
9
  for (let i = 0; i < 5000; i++) {
10
+ performance.mark('cog:init');
9
11
  const tiff = new CogTiff(source);
10
12
  await tiff.init();
13
+ performance.mark('cog:init:done');
11
14
  // 6 images
12
15
  for (const img of tiff.images)
13
16
  await img.getTile(0, 0);
14
- await tiff.close();
15
17
  }
16
18
  }
17
19
  main();
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29nLnJlYWQuYmVuY2htYXJrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL19fYmVuY2htYXJrX18vY29nLnJlYWQuYmVuY2htYXJrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDNUMsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN2QyxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFFekMsbUVBQW1FO0FBQ25FLEtBQUssVUFBVSxJQUFJO0lBQ2YsTUFBTSxHQUFHLEdBQUcsTUFBTSxRQUFRLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ2xFLE1BQU0sTUFBTSxHQUFHLElBQUksWUFBWSxDQUFDLEtBQUssRUFBRSxHQUFHLENBQUMsQ0FBQztJQUM1QyxLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsSUFBSyxFQUFFLENBQUMsRUFBRSxFQUFFO1FBQzVCLE1BQU0sSUFBSSxHQUFHLElBQUksT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQ2pDLE1BQU0sSUFBSSxDQUFDLElBQUksRUFBRSxDQUFDO1FBRWxCLFdBQVc7UUFDWCxLQUFLLE1BQU0sR0FBRyxJQUFJLElBQUksQ0FBQyxNQUFNO1lBQUUsTUFBTSxHQUFHLENBQUMsT0FBTyxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztRQUN2RCxNQUFNLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQztLQUN0QjtBQUNMLENBQUM7QUFFRCxJQUFJLEVBQUUsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFNvdXJjZU1lbW9yeSB9IGZyb20gJ0BjaHVua2QvY29yZSc7XG5pbXBvcnQgeyByZWFkRmlsZSB9IGZyb20gJ2ZzL3Byb21pc2VzJztcbmltcG9ydCB7IENvZ1RpZmYgfSBmcm9tICcuLi9jb2cudGlmZi5qcyc7XG5cbi8qKiBSZWFkIGEgdGlsZSBmcm9tIGV2ZXJ5IGltYWdlIGluc2lkZSBvZiBhIHRpZmYgMzAwIHRpbGVzIHJlYWQgKi9cbmFzeW5jIGZ1bmN0aW9uIG1haW4oKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgY29uc3QgYnVmID0gYXdhaXQgcmVhZEZpbGUocHJvY2Vzcy5hcmd2W3Byb2Nlc3MuYXJndi5sZW5ndGggLSAxXSk7XG4gICAgY29uc3Qgc291cmNlID0gbmV3IFNvdXJjZU1lbW9yeSgnYnVmJywgYnVmKTtcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IDVfMDAwOyBpKyspIHtcbiAgICAgICAgY29uc3QgdGlmZiA9IG5ldyBDb2dUaWZmKHNvdXJjZSk7XG4gICAgICAgIGF3YWl0IHRpZmYuaW5pdCgpO1xuXG4gICAgICAgIC8vIDYgaW1hZ2VzXG4gICAgICAgIGZvciAoY29uc3QgaW1nIG9mIHRpZmYuaW1hZ2VzKSBhd2FpdCBpbWcuZ2V0VGlsZSgwLCAwKTtcbiAgICAgICAgYXdhaXQgdGlmZi5jbG9zZSgpO1xuICAgIH1cbn1cblxubWFpbigpO1xuIl19
20
+ //# sourceMappingURL=cog.read.benchmark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cog.read.benchmark.js","sourceRoot":"","sources":["../../src/__benchmark__/cog.read.benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,+BAA+B;AAC/B,mEAAmE;AACnE,KAAK,UAAU,IAAI;IACjB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC;IACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAK,EAAE,CAAC,EAAE,EAAE;QAC9B,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC7B,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;QACjC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAElC,WAAW;QACX,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM;YAAE,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACxD;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { Source } from '../source.js';
3
+ export declare class TestFileSource implements Source {
4
+ url: URL;
5
+ data: Promise<Buffer>;
6
+ constructor(fileName: URL);
7
+ fetch(offset: number, length: number): Promise<ArrayBuffer>;
8
+ get size(): Promise<number>;
9
+ }
@@ -0,0 +1,29 @@
1
+ import { readFile, stat } from 'fs/promises';
2
+ export class TestFileSource {
3
+ constructor(fileName) {
4
+ Object.defineProperty(this, "url", {
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true,
8
+ value: void 0
9
+ });
10
+ Object.defineProperty(this, "data", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: void 0
15
+ });
16
+ this.url = fileName;
17
+ this.data = readFile(this.url);
18
+ }
19
+ async fetch(offset, length) {
20
+ const fileData = await this.data;
21
+ return fileData.buffer.slice(fileData.byteOffset + offset, fileData.byteOffset + offset + length);
22
+ }
23
+ get size() {
24
+ return Promise.resolve()
25
+ .then(() => stat(this.url))
26
+ .then((f) => f.size);
27
+ }
28
+ }
29
+ //# sourceMappingURL=source.file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.file.js","sourceRoot":"","sources":["../../src/__benchmark__/source.file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAG7C,MAAM,OAAO,cAAc;IAIzB,YAAY,QAAa;QAHzB;;;;;WAAS;QACT;;;;;WAAsB;QAGpB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,MAAc,EAAE,MAAc;QACxC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC;QACjC,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,GAAG,MAAM,EAAE,QAAQ,CAAC,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;IACpG,CAAC;IAED,IAAI,IAAI;QACN,OAAO,OAAO,CAAC,OAAO,EAAE;aACrB,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAC1B,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { Source } from '../source.js';
3
+ export declare class SourceMemory implements Source {
4
+ url: URL;
5
+ data: ArrayBuffer;
6
+ static toArrayBuffer(buf: Buffer | Uint8Array | ArrayBuffer): ArrayBuffer;
7
+ constructor(bytes: Buffer | Uint8Array | ArrayBuffer);
8
+ fetch(offset: number, length?: number): Promise<ArrayBuffer>;
9
+ }