@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.
@@ -46,4 +46,5 @@ export default class GeoImage {
46
46
  getColorValue(dataArray: [], options: GeoImageOptions, arrayLength: number, numOfChannels?: number): any[];
47
47
  getDefaultColor(size: any, nullColor: any): any[];
48
48
  getColorFromChromaType(colorDefinition: any): any[];
49
+ hasPixelsNoData(pixels: any, noDataValue: any): any;
49
50
  }
package/dist/esm/index.js CHANGED
@@ -14104,14 +14104,18 @@ class GeoImage {
14104
14104
  imageData.data[index] = value;
14105
14105
  });
14106
14106
  }
14107
+ // RGB values in one channel
14107
14108
  if (rasters[0].length / (width * height) === 3) {
14108
14109
  // console.log("geoImage: " + "RGB 1 array of length: " + rasters[0].length);
14109
14110
  let pixel = 0;
14110
- for (let i = 0; i < size; i += 4) {
14111
- imageData.data[i] = rasters[0][pixel += 1];
14112
- imageData.data[i + 1] = rasters[0][pixel += 1];
14113
- imageData.data[i + 2] = rasters[0][pixel += 1];
14114
- imageData.data[i + 3] = optionsLocal.alpha;
14111
+ for (let idx = 0; idx < size; idx += 4) {
14112
+ const rgbColor = [rasters[0][pixel], rasters[0][pixel + 1], rasters[0][pixel + 2]];
14113
+ const rgbaColor = this.hasPixelsNoData(rgbColor, optionsLocal.noDataValue)
14114
+ ? optionsLocal.nullColor
14115
+ : [...rgbColor, optionsLocal.alpha];
14116
+ // eslint-disable-next-line max-len
14117
+ [imageData.data[idx], imageData.data[idx + 1], imageData.data[idx + 2], imageData.data[idx + 3]] = rgbaColor;
14118
+ pixel += 3;
14115
14119
  }
14116
14120
  }
14117
14121
  if (rasters[0].length / (width * height) === 4) {
@@ -14254,6 +14258,9 @@ class GeoImage {
14254
14258
  }
14255
14259
  return colorDefinition;
14256
14260
  }
14261
+ hasPixelsNoData(pixels, noDataValue) {
14262
+ return noDataValue !== undefined && pixels.every((pixel) => pixel === noDataValue);
14263
+ }
14257
14264
  }
14258
14265
 
14259
14266
  const EARTH_CIRCUMFERENCE = 40075000.0;
@@ -14715,6 +14722,7 @@ class CogTerrainLayer extends CompositeLayer {
14715
14722
  props.tile.bbox.east,
14716
14723
  props.tile.bbox.north,
14717
14724
  ],
14725
+ operation: 'terrain+draw',
14718
14726
  minZoom: this.minZoom,
14719
14727
  maxZoom: this.maxZoom,
14720
14728
  loadOptions: {