@thi.ng/pixel-io-geotiff 0.2.4 → 0.2.6
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/README.md +12 -11
- package/package.json +6 -6
- package/read.js +3 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
|
-
<!-- Please see: https://
|
|
3
|
-
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/pixel-io-geotiff)
|
|
6
6
|

|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
10
|
> This is one of 214 standalone projects, maintained as part
|
|
11
|
-
> of the [@thi.ng/umbrella](https://
|
|
11
|
+
> of the [@thi.ng/umbrella](https://codeberg.org/thi.ng/umbrella/) ecosystem
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
|
14
|
-
> 🚀 Please help me to work full-time on these projects by [sponsoring
|
|
15
|
-
>
|
|
14
|
+
> 🚀 Please help me to work full-time on these projects by [sponsoring
|
|
15
|
+
> me](https://codeberg.org/thi.ng/umbrella/src/branch/develop/CONTRIBUTING.md#donations).
|
|
16
|
+
> Thank you! ❤️
|
|
16
17
|
|
|
17
18
|
- [About](#about)
|
|
18
19
|
- [Status](#status)
|
|
@@ -24,9 +25,9 @@
|
|
|
24
25
|
|
|
25
26
|
## About
|
|
26
27
|
|
|
27
|
-
GeoTIFF reader support for [@thi.ng/pixel](https://
|
|
28
|
+
GeoTIFF reader support for [@thi.ng/pixel](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/pixel).
|
|
28
29
|
|
|
29
|
-

|
|
30
31
|
|
|
31
32
|
This package is only intended to simplify obtaining DEM (elevation) data and not
|
|
32
33
|
aimed at general
|
|
@@ -38,7 +39,7 @@ functionality. For the latter we recommend using the wrapped
|
|
|
38
39
|
|
|
39
40
|
**STABLE** - used in production
|
|
40
41
|
|
|
41
|
-
[Search or submit any issues for this package](https://
|
|
42
|
+
[Search or submit any issues for this package](https://codeberg.org/thi.ng/umbrella/issues?q=%5Bpixel-io-geotiff%5D)
|
|
42
43
|
|
|
43
44
|
## Installation
|
|
44
45
|
|
|
@@ -70,9 +71,9 @@ Package sizes (brotli'd, pre-treeshake): ESM: 474 bytes
|
|
|
70
71
|
|
|
71
72
|
## Dependencies
|
|
72
73
|
|
|
73
|
-
- [@thi.ng/api](https://
|
|
74
|
-
- [@thi.ng/math](https://
|
|
75
|
-
- [@thi.ng/pixel](https://
|
|
74
|
+
- [@thi.ng/api](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/api)
|
|
75
|
+
- [@thi.ng/math](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/math)
|
|
76
|
+
- [@thi.ng/pixel](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/pixel)
|
|
76
77
|
- [geotiff](https://github.com/geotiffjs/geotiff.js)
|
|
77
78
|
|
|
78
79
|
Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
|
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.6",
|
|
4
4
|
"description": "GeoTIFF reader support for @thi.ng/pixel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://
|
|
11
|
+
"url": "git+https://codeberg.org/thi.ng/umbrella.git",
|
|
12
12
|
"directory": "packages/pixel-io-geotiff"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://thi.ng/pixel-io-geotiff",
|
|
@@ -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.18",
|
|
44
|
+
"@thi.ng/math": "^5.15.7",
|
|
45
|
+
"@thi.ng/pixel": "^7.5.27",
|
|
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": "8ddf86ea0a1e658ddbf19cc645b29d0c176e29c4\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;
|