@thi.ng/pixel-io-geotiff 0.2.3 → 0.2.5
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/package.json +5 -5
- package/read.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/pixel-io-geotiff",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "GeoTIFF reader support for @thi.ng/pixel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.12.
|
|
44
|
-
"@thi.ng/math": "^5.15.
|
|
45
|
-
"@thi.ng/pixel": "^7.5.
|
|
43
|
+
"@thi.ng/api": "^8.12.17",
|
|
44
|
+
"@thi.ng/math": "^5.15.6",
|
|
45
|
+
"@thi.ng/pixel": "^7.5.26",
|
|
46
46
|
"geotiff": "2.1.4-beta.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"year": 2023,
|
|
93
93
|
"screenshot": "pixel-io-geotiff/20230109-n45w121-crop-1280.jpg"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "1107498d31504dc63d1a457b5def387d7a134f69\n"
|
|
96
96
|
}
|
package/read.js
CHANGED
|
@@ -7,7 +7,9 @@ const readGeoTiff = async (src, opts = {}) => {
|
|
|
7
7
|
const tiffImg = await tiff.getImage();
|
|
8
8
|
const width = tiffImg.getWidth();
|
|
9
9
|
const height = tiffImg.getHeight();
|
|
10
|
-
const pool = opts.pool instanceof Pool ? opts.pool : opts.pool ? new Pool(
|
|
10
|
+
const pool = opts.pool instanceof Pool ? opts.pool : opts.pool ? new Pool(
|
|
11
|
+
typeof opts.pool === "number" ? opts.pool : void 0
|
|
12
|
+
) : void 0;
|
|
11
13
|
const data = (await tiffImg.readRasters({ pool, samples: [opts.channel || 0] }))[0];
|
|
12
14
|
if (opts.clamp) {
|
|
13
15
|
const [min2, max2] = opts.clamp;
|