@gisatcz/deckgl-geolib 1.4.2 → 1.5.0-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/CHANGELOG.md CHANGED
@@ -1,15 +1,3 @@
1
- # v1.4.2 (Wed Jun 21 2023)
2
-
3
- #### 🐾 Patch
4
-
5
- - remove unused line [#22](https://github.com/gisat-panther/deck.gl-geotiff/pull/22) ([@vdubr](https://github.com/vdubr))
6
-
7
- #### Authors: 1
8
-
9
- - Vojtěch Dubrovský ([@vdubr](https://github.com/vdubr))
10
-
11
- ---
12
-
13
1
  # v1.4.1 (Tue Jun 20 2023)
14
2
 
15
3
  #### ⚠️ Pushed to `master`
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 i = 0; i < size; i += 4) {
14113
- imageData.data[i] = rasters[0][pixel += 1];
14114
- imageData.data[i + 1] = rasters[0][pixel += 1];
14115
- imageData.data[i + 2] = rasters[0][pixel += 1];
14116
- imageData.data[i + 3] = optionsLocal.alpha;
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;
@@ -14717,6 +14724,7 @@ class CogTerrainLayer extends core.CompositeLayer {
14717
14724
  props.tile.bbox.east,
14718
14725
  props.tile.bbox.north,
14719
14726
  ],
14727
+ operation: 'terrain+draw',
14720
14728
  minZoom: this.minZoom,
14721
14729
  maxZoom: this.maxZoom,
14722
14730
  loadOptions: {