@gisatcz/deckgl-geolib 1.4.1 → 1.4.3-dev.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/dist/cjs/index.js +12 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +1 -1
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/types/geoimage/geoimage.d.ts +1 -0
- package/dist/esm/index.js +12 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/types/geoimage/geoimage.d.ts +1 -0
- package/package.json +1 -1
- package/src/geoimage/geoimage.ts +13 -5
package/dist/cjs/index.js
CHANGED
|
@@ -14106,14 +14106,18 @@ class GeoImage {
|
|
|
14106
14106
|
imageData.data[index] = value;
|
|
14107
14107
|
});
|
|
14108
14108
|
}
|
|
14109
|
+
// RGB values in one channel
|
|
14109
14110
|
if (rasters[0].length / (width * height) === 3) {
|
|
14110
14111
|
// console.log("geoImage: " + "RGB 1 array of length: " + rasters[0].length);
|
|
14111
14112
|
let pixel = 0;
|
|
14112
|
-
for (let
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14113
|
+
for (let idx = 0; idx < size; idx += 4) {
|
|
14114
|
+
const rgbColor = [rasters[0][pixel], rasters[0][pixel + 1], rasters[0][pixel + 2]];
|
|
14115
|
+
const rgbaColor = this.hasPixelsNoData(rgbColor, optionsLocal.noDataValue)
|
|
14116
|
+
? optionsLocal.nullColor
|
|
14117
|
+
: [...rgbColor, optionsLocal.alpha];
|
|
14118
|
+
// eslint-disable-next-line max-len
|
|
14119
|
+
[imageData.data[idx], imageData.data[idx + 1], imageData.data[idx + 2], imageData.data[idx + 3]] = rgbaColor;
|
|
14120
|
+
pixel += 3;
|
|
14117
14121
|
}
|
|
14118
14122
|
}
|
|
14119
14123
|
if (rasters[0].length / (width * height) === 4) {
|
|
@@ -14256,6 +14260,9 @@ class GeoImage {
|
|
|
14256
14260
|
}
|
|
14257
14261
|
return colorDefinition;
|
|
14258
14262
|
}
|
|
14263
|
+
hasPixelsNoData(pixels, noDataValue) {
|
|
14264
|
+
return noDataValue !== undefined && pixels.every((pixel) => pixel === noDataValue);
|
|
14265
|
+
}
|
|
14259
14266
|
}
|
|
14260
14267
|
|
|
14261
14268
|
const EARTH_CIRCUMFERENCE = 40075000.0;
|