@gisatcz/deckgl-geolib 2.1.2-dev.1 → 2.1.4-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/README.md +1 -0
- package/dist/cjs/index.js +515 -457
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +2 -2
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/esm/index.js +515 -457
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +2 -2
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/types/core/CogTiles.d.ts +8 -6
- package/dist/esm/types/core/GeoImage.d.ts +5 -49
- package/dist/esm/types/core/lib/BitmapGenerator.d.ts +15 -0
- package/dist/esm/types/core/lib/DataUtils.d.ts +1 -0
- package/dist/esm/types/core/lib/TerrainGenerator.d.ts +55 -0
- package/dist/esm/types/core/types.d.ts +42 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GeoTIFF, GeoTIFFImage } from 'geotiff';
|
|
2
|
-
import GeoImage
|
|
2
|
+
import GeoImage from './GeoImage';
|
|
3
|
+
import { GeoImageOptions } from './types';
|
|
3
4
|
export type Bounds = [minX: number, minY: number, maxX: number, maxY: number];
|
|
4
5
|
declare class CogTiles {
|
|
5
6
|
cog: GeoTIFF;
|
|
@@ -47,13 +48,13 @@ declare class CogTiles {
|
|
|
47
48
|
* @returns {number} The index of the image in the COG that best matches the specified zoom level.
|
|
48
49
|
*/
|
|
49
50
|
getImageIndexForZoomLevel(zoom: any): number;
|
|
50
|
-
getTileFromImage(tileX: any, tileY: any, zoom: any, fetchSize?: number): Promise<
|
|
51
|
+
getTileFromImage(tileX: any, tileY: any, zoom: any, fetchSize?: number): Promise<(Float32Array<ArrayBuffer> | Int8Array<ArrayBuffer> | Uint8Array<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float64Array<ArrayBuffer>)[] | import("geotiff").TypedArrayWithDimensions[]>;
|
|
51
52
|
/**
|
|
52
53
|
* Creates a blank tile buffer filled with the "No Data" value.
|
|
53
54
|
* @param size The width/height of the square tile (e.g., 256 or 257)
|
|
54
55
|
*/
|
|
55
56
|
createEmptyTile(size?: number): Float32Array<ArrayBuffer>;
|
|
56
|
-
getTile(x: number, y: number, z: number, bounds: Bounds, meshMaxError: number): Promise<
|
|
57
|
+
getTile(x: number, y: number, z: number, bounds: Bounds, meshMaxError: number): Promise<{
|
|
57
58
|
loaderData: {
|
|
58
59
|
header: {};
|
|
59
60
|
};
|
|
@@ -76,7 +77,7 @@ declare class CogTiles {
|
|
|
76
77
|
size: number;
|
|
77
78
|
};
|
|
78
79
|
};
|
|
79
|
-
}>;
|
|
80
|
+
} | ImageBitmap>;
|
|
80
81
|
/**
|
|
81
82
|
* Determines the data type (e.g., "Int32", "Float64") of a GeoTIFF image
|
|
82
83
|
* by reading its TIFF tags.
|
|
@@ -98,8 +99,9 @@ declare class CogTiles {
|
|
|
98
99
|
*
|
|
99
100
|
* @param {string} dataType - A string specifying the data type (e.g., "Int32", "Float64", "UInt16", etc.).
|
|
100
101
|
* @param {number} tileSize - The width/height of the square tile.
|
|
101
|
-
* @
|
|
102
|
+
* @param {number} multiplier - Optional multiplier for interleaved buffers (e.g., numChannels).
|
|
103
|
+
* @returns {TypedArray} A typed array buffer of length (tileSize * tileSize * multiplier).
|
|
102
104
|
*/
|
|
103
|
-
createTileBuffer(dataType:
|
|
105
|
+
createTileBuffer(dataType: string, tileSize: number, multiplier?: number): Float32Array<ArrayBuffer> | Int8Array<ArrayBuffer> | Uint8Array<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float64Array<ArrayBuffer>;
|
|
104
106
|
}
|
|
105
107
|
export default CogTiles;
|
|
@@ -1,53 +1,15 @@
|
|
|
1
1
|
import { GeoTIFFImage } from 'geotiff';
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
export type ClampToTerrainOptions = {
|
|
5
|
-
terrainDrawMode?: string;
|
|
6
|
-
};
|
|
7
|
-
export type GeoImageOptions = {
|
|
8
|
-
type: 'image' | 'terrain';
|
|
9
|
-
tesselator?: 'martini' | 'delatin';
|
|
10
|
-
format?: 'uint8' | 'uint16' | 'uint32' | 'int8' | 'int16' | 'int32' | 'float32' | 'float64';
|
|
11
|
-
useHeatMap?: boolean;
|
|
12
|
-
useColorsBasedOnValues?: boolean;
|
|
13
|
-
useColorClasses?: boolean;
|
|
14
|
-
useAutoRange?: boolean;
|
|
15
|
-
useDataForOpacity?: boolean;
|
|
16
|
-
useChannel?: Exclude<number, 0> | null;
|
|
17
|
-
useChannelIndex?: number | null;
|
|
18
|
-
useSingleColor?: boolean;
|
|
19
|
-
blurredTexture?: boolean;
|
|
20
|
-
clipLow?: number | null;
|
|
21
|
-
clipHigh?: number | null;
|
|
22
|
-
multiplier?: number;
|
|
23
|
-
color?: Array<number> | chroma.Color;
|
|
24
|
-
colorScale?: Array<string> | Array<chroma.Color>;
|
|
25
|
-
colorScaleValueRange?: number[];
|
|
26
|
-
colorsBasedOnValues?: [number | undefined, chroma.Color][];
|
|
27
|
-
colorClasses?: [chroma.Color, [number, number], [boolean, boolean]?][];
|
|
28
|
-
alpha?: number;
|
|
29
|
-
noDataValue?: number;
|
|
30
|
-
numOfChannels?: number;
|
|
31
|
-
nullColor?: Array<number> | chroma.Color;
|
|
32
|
-
unidentifiedColor?: Array<number> | chroma.Color;
|
|
33
|
-
clippedColor?: Array<number> | chroma.Color;
|
|
34
|
-
clampToTerrain?: ClampToTerrainOptions | boolean;
|
|
35
|
-
terrainColor?: Array<number> | chroma.Color;
|
|
36
|
-
terrainSkirtHeight?: number;
|
|
37
|
-
terrainMinValue?: number;
|
|
38
|
-
planarConfig?: number;
|
|
39
|
-
};
|
|
40
|
-
export declare const DefaultGeoImageOptions: GeoImageOptions;
|
|
2
|
+
import { GeoImageOptions, Bounds } from './types';
|
|
3
|
+
export * from './types';
|
|
41
4
|
export default class GeoImage {
|
|
42
5
|
data: GeoTIFFImage | undefined;
|
|
43
|
-
scale: (num: number, inMin: number, inMax: number, outMin: number, outMax: number) => number;
|
|
44
6
|
setUrl(url: string): Promise<void>;
|
|
45
7
|
getMap(input: string | {
|
|
46
8
|
width: number;
|
|
47
9
|
height: number;
|
|
48
10
|
rasters: any[];
|
|
49
11
|
bounds: Bounds;
|
|
50
|
-
}, options: GeoImageOptions, meshMaxError: any): Promise<
|
|
12
|
+
}, options: GeoImageOptions, meshMaxError: any): Promise<{
|
|
51
13
|
loaderData: {
|
|
52
14
|
header: {};
|
|
53
15
|
};
|
|
@@ -70,7 +32,7 @@ export default class GeoImage {
|
|
|
70
32
|
size: number;
|
|
71
33
|
};
|
|
72
34
|
};
|
|
73
|
-
}>;
|
|
35
|
+
} | ImageBitmap>;
|
|
74
36
|
getHeightmap(input: string | {
|
|
75
37
|
bounds: Bounds;
|
|
76
38
|
width: number;
|
|
@@ -104,11 +66,5 @@ export default class GeoImage {
|
|
|
104
66
|
width: number;
|
|
105
67
|
height: number;
|
|
106
68
|
rasters: any[];
|
|
107
|
-
}, options: GeoImageOptions): Promise<
|
|
108
|
-
getMinMax(array: any, options: any): any[];
|
|
109
|
-
getColorValue(dataArray: [], options: GeoImageOptions, arrayLength: number, numOfChannels?: number): any[];
|
|
110
|
-
findClassIndex(number: any, intervals: any, bounds: any): number;
|
|
111
|
-
getDefaultColor(size: any, nullColor: any): any[];
|
|
112
|
-
getColorFromChromaType(colorDefinition: any): any[];
|
|
113
|
-
hasPixelsNoData(pixels: any, noDataValue: any): any;
|
|
69
|
+
}, options: GeoImageOptions): Promise<ImageBitmap>;
|
|
114
70
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import chroma from 'chroma-js';
|
|
2
|
+
import { GeoImageOptions, TypedArray } from '../types';
|
|
3
|
+
export declare class BitmapGenerator {
|
|
4
|
+
static generate(input: {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
rasters: TypedArray[];
|
|
8
|
+
}, options: GeoImageOptions): Promise<ImageBitmap>;
|
|
9
|
+
static getMinMax(array: TypedArray, options: GeoImageOptions, samplesPerPixel?: number): number[];
|
|
10
|
+
static getColorValue(dataArray: TypedArray | any[], options: GeoImageOptions, arrayLength: number, samplesPerPixel?: number): Uint8ClampedArray<ArrayBuffer>;
|
|
11
|
+
static findClassIndex(number: number, intervals: [number, number][], bounds: [boolean, boolean][]): number;
|
|
12
|
+
static getDefaultColor(size: number, nullColor: number[]): Uint8ClampedArray<ArrayBuffer>;
|
|
13
|
+
static getColorFromChromaType(colorDefinition: number[] | chroma.Color, alpha?: number): number[];
|
|
14
|
+
static hasPixelsNoData(pixels: any[], noDataValue: any): boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function scale(num: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { GeoImageOptions, Bounds, TypedArray } from '../types';
|
|
2
|
+
export declare class TerrainGenerator {
|
|
3
|
+
static generate(input: {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
rasters: TypedArray[];
|
|
7
|
+
bounds: Bounds;
|
|
8
|
+
}, options: GeoImageOptions, meshMaxError: number): {
|
|
9
|
+
loaderData: {
|
|
10
|
+
header: {};
|
|
11
|
+
};
|
|
12
|
+
header: {
|
|
13
|
+
vertexCount: any;
|
|
14
|
+
boundingBox: [[number, number, number], [number, number, number]];
|
|
15
|
+
};
|
|
16
|
+
mode: number;
|
|
17
|
+
indices: {
|
|
18
|
+
value: Uint32Array<ArrayBuffer>;
|
|
19
|
+
size: number;
|
|
20
|
+
};
|
|
21
|
+
attributes: {
|
|
22
|
+
POSITION: {
|
|
23
|
+
value: Float32Array<ArrayBuffer>;
|
|
24
|
+
size: number;
|
|
25
|
+
};
|
|
26
|
+
TEXCOORD_0: {
|
|
27
|
+
value: Float32Array<ArrayBuffer>;
|
|
28
|
+
size: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Decodes raw raster data into a Float32Array of elevation values.
|
|
34
|
+
* Handles channel selection, value scaling, data type validation, and border stitching.
|
|
35
|
+
*/
|
|
36
|
+
private static computeTerrainData;
|
|
37
|
+
static getMartiniTileMesh(meshMaxError: number, width: number, terrain: Float32Array): {
|
|
38
|
+
vertices: any;
|
|
39
|
+
triangles: any;
|
|
40
|
+
};
|
|
41
|
+
static getDelatinTileMesh(meshMaxError: number, width: number, height: number, terrain: Float32Array): {
|
|
42
|
+
vertices: any;
|
|
43
|
+
triangles: any;
|
|
44
|
+
};
|
|
45
|
+
static getMeshAttributes(vertices: Uint16Array | Uint32Array | Float32Array | Float64Array, terrain: Float32Array, width: number, height: number, bounds: Bounds | number[]): {
|
|
46
|
+
POSITION: {
|
|
47
|
+
value: Float32Array<ArrayBuffer>;
|
|
48
|
+
size: number;
|
|
49
|
+
};
|
|
50
|
+
TEXCOORD_0: {
|
|
51
|
+
value: Float32Array<ArrayBuffer>;
|
|
52
|
+
size: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import chroma from 'chroma-js';
|
|
2
|
+
export type Bounds = [minX: number, minY: number, maxX: number, maxY: number];
|
|
3
|
+
export type ClampToTerrainOptions = {
|
|
4
|
+
terrainDrawMode?: string;
|
|
5
|
+
};
|
|
6
|
+
export type GeoImageOptions = {
|
|
7
|
+
type: 'image' | 'terrain';
|
|
8
|
+
tesselator?: 'martini' | 'delatin';
|
|
9
|
+
format?: 'uint8' | 'uint16' | 'uint32' | 'int8' | 'int16' | 'int32' | 'float32' | 'float64';
|
|
10
|
+
useHeatMap?: boolean;
|
|
11
|
+
useColorsBasedOnValues?: boolean;
|
|
12
|
+
useColorClasses?: boolean;
|
|
13
|
+
useAutoRange?: boolean;
|
|
14
|
+
useDataForOpacity?: boolean;
|
|
15
|
+
/** 1-based index of the channel to visualize (e.g. 1 for the first channel). */
|
|
16
|
+
useChannel?: number | null;
|
|
17
|
+
/** 0-based index of the channel to visualize (e.g. 0 for the first channel). Alternative to useChannel. */
|
|
18
|
+
useChannelIndex?: number | null;
|
|
19
|
+
useSingleColor?: boolean;
|
|
20
|
+
blurredTexture?: boolean;
|
|
21
|
+
clipLow?: number | null;
|
|
22
|
+
clipHigh?: number | null;
|
|
23
|
+
multiplier?: number;
|
|
24
|
+
color?: Array<number> | chroma.Color;
|
|
25
|
+
colorScale?: Array<string> | Array<chroma.Color>;
|
|
26
|
+
colorScaleValueRange?: number[];
|
|
27
|
+
colorsBasedOnValues?: [number | undefined, chroma.Color][];
|
|
28
|
+
colorClasses?: [chroma.Color, [number, number], [boolean, boolean]?][];
|
|
29
|
+
alpha?: number;
|
|
30
|
+
noDataValue?: number;
|
|
31
|
+
numOfChannels?: number;
|
|
32
|
+
nullColor?: Array<number> | chroma.Color;
|
|
33
|
+
unidentifiedColor?: Array<number> | chroma.Color;
|
|
34
|
+
clippedColor?: Array<number> | chroma.Color;
|
|
35
|
+
clampToTerrain?: ClampToTerrainOptions | boolean;
|
|
36
|
+
terrainColor?: Array<number> | chroma.Color;
|
|
37
|
+
terrainSkirtHeight?: number;
|
|
38
|
+
terrainMinValue?: number;
|
|
39
|
+
planarConfig?: number;
|
|
40
|
+
};
|
|
41
|
+
export declare const DefaultGeoImageOptions: GeoImageOptions;
|
|
42
|
+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|