@gisatcz/deckgl-geolib 2.5.1-dev.1 → 2.6.0-dev.2

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.
@@ -11,6 +11,7 @@ declare class CogTiles {
11
11
  zoomRange: number[];
12
12
  tileSize: number;
13
13
  bounds: [number, number, number, number];
14
+ bandDescriptions: string[];
14
15
  geo: GeoImage;
15
16
  options: GeoImageOptions;
16
17
  private cache;
@@ -22,9 +23,19 @@ declare class CogTiles {
22
23
  getZoomRange(): number[];
23
24
  getBoundsAsLatLon(): [number, number, number, number];
24
25
  /**
25
- * Gets the auto meshMaxError for a given overview index.
26
- * Returns undefined if auto lookup has not been computed.
26
+ * Gets the number of channels/bands in the COG.
27
+ * Returns the value from COG metadata, or 1 if not initialized.
27
28
  */
29
+ getNumChannels(): number;
30
+ /**
31
+ * Returns per-band descriptions loaded from GDAL_METADATA during initialization.
32
+ * Index is 0-based. Returns an empty string for bands without a description.
33
+ */
34
+ getBandDescriptions(): string[];
35
+ /**
36
+ * Gets the auto meshMaxError for a given overview index.
37
+ * Returns undefined if auto lookup has not been computed.
38
+ */
28
39
  getMeshMaxErrorForImageIndex(imageIndex: number): number | undefined;
29
40
  /**
30
41
  * Computes dynamic meshMaxError values for each overview based on COG resolution and zoom level.
@@ -50,6 +61,7 @@ declare class CogTiles {
50
61
  private getTerrainTile;
51
62
  private getGlazeTile;
52
63
  private getBitmapTile;
64
+ getTileAllBands(x: number, y: number, z: number, meshMaxError?: number, signal?: AbortSignal, bounds?: Bounds): Promise<TileResult[]>;
53
65
  clearTileResultCache(): void;
54
66
  }
55
67
  export default CogTiles;
@@ -81,6 +81,8 @@ export type GeoImageOptions = {
81
81
  /** Strategy for detecting all-noData tiles. Options: 'full' | 'border+center' */
82
82
  noDataCheck?: 'full' | 'border+center';
83
83
  disableLighting?: boolean;
84
+ /** When true, fetch and cache all bands for a tile on first access. Enables instant slider animation. */
85
+ cacheAllBands?: boolean;
84
86
  };
85
87
  export declare const DefaultGeoImageOptions: GeoImageOptions;
86
88
  export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
@@ -1,4 +1,6 @@
1
1
  export { CogBitmapLayer, CogTerrainLayer } from './layers/index';
2
2
  export { CogTiles, GeoImage } from './core/index';
3
3
  export { suppressGlobalAbortErrors } from './utils/suppressAbortErrors';
4
+ export { extractTerrainCoordinate, sampleTerrainTileCoordinates } from './utils/terrainPickingUtils';
4
5
  export type { GeoImageOptions } from './core/index';
6
+ export type { TerrainCoordinate } from './utils/terrainPickingUtils';
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Terrain coordinate extraction utility for CogTerrainLayer
3
+ * Enables precise lat/lon/elevation extraction from 3D terrain picks
4
+ */
5
+ /**
6
+ * Represents a geographic coordinate with elevation from terrain picking
7
+ */
8
+ export interface TerrainCoordinate {
9
+ /** Longitude in degrees */
10
+ longitude: number;
11
+ /** Latitude in degrees */
12
+ latitude: number;
13
+ /** Elevation in meters */
14
+ elevation: number;
15
+ }
16
+ /**
17
+ * Extracts precise geographic coordinates and elevation from a CogTerrainLayer pick result
18
+ *
19
+ * @param pickResult - DeckGL pickObject result from terrain-layer pick
20
+ * @returns TerrainCoordinate with lon/lat/elevation, or null if extraction fails
21
+ *
22
+ * @requires deck.gl >=9.3.0 (for `pickable: '3d'` support)
23
+ * @note Requires `pickable: '3d'` on CogTerrainLayer. With 3D picking enabled,
24
+ * deck.gl's terrain layer provides info.coordinate as a 3-element array [lon, lat, elevation]
25
+ * where elevation is read directly from the terrain mesh at the picked point.
26
+ * This gives accurate 3D coordinates regardless of camera pitch or bearing.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const cogLayer = new CogTerrainLayer({
31
+ * // ...
32
+ * pickable: '3d', // Requires deck.gl >=9.3.0
33
+ * onClick: (info) => {
34
+ * const coord = extractTerrainCoordinate(info);
35
+ * if (coord) {
36
+ * console.log(`Clicked at ${coord.latitude}, ${coord.longitude}, elevation: ${coord.elevation}m`);
37
+ * }
38
+ * }
39
+ * });
40
+ * ```
41
+ */
42
+ export declare function extractTerrainCoordinate(pickResult: any): TerrainCoordinate | null;
43
+ /**
44
+ * Samples terrain coordinates in a grid around a pick point for debugging
45
+ * Useful for understanding terrain data layout and accuracy
46
+ *
47
+ * @param pickResult - DeckGL pickObject result from terrain-layer pick
48
+ * @param gridSize - Odd number for grid dimensions (default: 3 for 3x3 grid).
49
+ * gridSize=3 → 3×3 grid (offset±1), gridSize=5 → 5×5 grid (offset±2).
50
+ * Uses WebMercator projection for accurate latitude mapping.
51
+ * @returns Array of TerrainCoordinate samples, or empty array if extraction fails
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const samples = sampleTerrainTileCoordinates(info, 5); // 5x5 grid around click
56
+ * samples.forEach(coord => {
57
+ * console.log(`Sample: ${coord.latitude}, ${coord.longitude}, elev: ${coord.elevation}m`);
58
+ * });
59
+ * ```
60
+ */
61
+ export declare function sampleTerrainTileCoordinates(pickResult: any, gridSize?: number): TerrainCoordinate[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gisatcz/deckgl-geolib",
3
- "version": "2.5.1-dev.1",
3
+ "version": "2.6.0-dev.2",
4
4
  "description": "Deck.gl extension for rendering Cloud-Optimized GeoTIFF (COG) data",
5
5
  "keywords": [
6
6
  "deck.gl",
@@ -67,17 +67,17 @@
67
67
  "@luma.gl/shadertools": ">=9.0.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@deck.gl/core": "^9.2.11",
71
- "@deck.gl/extensions": "^9.2.11",
72
- "@deck.gl/geo-layers": "^9.2.11",
73
- "@deck.gl/layers": "^9.2.11",
74
- "@deck.gl/mesh-layers": "^9.2.11",
75
- "@loaders.gl/core": "^4.3.4",
76
- "@loaders.gl/loader-utils": "^4.3.4",
77
- "@loaders.gl/schema": "^4.3.4",
78
- "@luma.gl/core": "^9.2.6",
79
- "@luma.gl/engine": "^9.2.6",
80
- "@luma.gl/shadertools": "^9.2.6",
70
+ "@deck.gl/core": "^9.3.2",
71
+ "@deck.gl/extensions": "^9.3.2",
72
+ "@deck.gl/geo-layers": "^9.3.2",
73
+ "@deck.gl/layers": "^9.3.2",
74
+ "@deck.gl/mesh-layers": "^9.3.2",
75
+ "@loaders.gl/core": "^4.4.1",
76
+ "@loaders.gl/loader-utils": "^4.4.1",
77
+ "@loaders.gl/schema": "^4.4.1",
78
+ "@luma.gl/core": "^9.3.3",
79
+ "@luma.gl/engine": "^9.3.3",
80
+ "@luma.gl/shadertools": "^9.3.3",
81
81
  "@rollup/plugin-commonjs": "^29.0.2",
82
82
  "@rollup/plugin-json": "^6.1.0",
83
83
  "@rollup/plugin-node-resolve": "^16.0.3",