@gisatcz/deckgl-geolib 1.5.0-dev.0 → 1.6.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.
@@ -1,5 +1,8 @@
1
1
  import { GeoTIFFImage } from 'geotiff';
2
2
  import chroma from 'chroma-js';
3
+ export type ClampToTerrainOptions = {
4
+ terrainDrawMode?: string;
5
+ };
3
6
  export type GeoImageOptions = {
4
7
  type: 'image' | 'terrain';
5
8
  format?: 'uint8' | 'uint16' | 'uint32' | 'int8' | 'int16' | 'int32' | 'float32' | 'float64';
@@ -22,6 +25,7 @@ export type GeoImageOptions = {
22
25
  nullColor?: Array<number> | chroma.Color;
23
26
  unidentifiedColor?: Array<number> | chroma.Color;
24
27
  clippedColor?: Array<number> | chroma.Color;
28
+ clampToTerrain?: ClampToTerrainOptions | boolean;
25
29
  };
26
30
  export default class GeoImage {
27
31
  data: GeoTIFFImage | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisatcz/deckgl-geolib",
3
- "version": "1.5.0-dev.0",
3
+ "version": "1.6.0-dev.0",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,6 +1,7 @@
1
1
  import { CompositeLayer } from '@deck.gl/core';
2
2
  import { TileLayer } from '@deck.gl/geo-layers';
3
3
  import { BitmapLayer } from '@deck.gl/layers';
4
+ import { _TerrainExtension as TerrainExtension } from '@deck.gl/extensions';
4
5
  import CogTiles from '../cogtiles/cogtiles.ts';
5
6
 
6
7
  import { GeoImageOptions } from '../geoimage/geoimage.ts';
@@ -93,6 +94,10 @@ class CogBitmapLayer extends CompositeLayer<any> {
93
94
  image: props.data,
94
95
  bounds: [west, south, east, north],
95
96
  opacity: 1, // 0.6
97
+ extensions: this.cogTiles?.options?.clampToTerrain ? [new TerrainExtension()] : [],
98
+ ...(this.cogTiles?.options?.clampToTerrain?.terrainDrawMode
99
+ ? { terrainDrawMode: this.cogTiles?.options?.clampToTerrain.terrainDrawMode }
100
+ : {}),
96
101
  });
97
102
  },
98
103
  });
@@ -4,6 +4,9 @@
4
4
  import { fromArrayBuffer, GeoTIFFImage, TypedArray } from 'geotiff';
5
5
  import chroma from 'chroma-js';
6
6
 
7
+ export type ClampToTerrainOptions = {
8
+ terrainDrawMode?: string
9
+ }
7
10
  export type GeoImageOptions = {
8
11
  type: 'image' | 'terrain',
9
12
  format?: 'uint8' | 'uint16' | 'uint32' |'int8' | 'int16' | 'int32' | 'float32' | 'float64'
@@ -25,7 +28,8 @@ export type GeoImageOptions = {
25
28
  numOfChannels?: number,
26
29
  nullColor?: Array<number> | chroma.Color
27
30
  unidentifiedColor?: Array<number> | chroma.Color,
28
- clippedColor?: Array<number> | chroma.Color
31
+ clippedColor?: Array<number> | chroma.Color,
32
+ clampToTerrain?: ClampToTerrainOptions | boolean, // terrainDrawMode: 'drape',
29
33
  }
30
34
 
31
35
  const DefaultGeoImageOptions: GeoImageOptions = {