@gisatcz/deckgl-geolib 2.3.1-dev.1 → 2.4.0-dev.1
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 +35 -5
- package/dist/cjs/index.js +381 -169
- 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 +381 -169
- 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 +2 -2
- package/dist/esm/types/core/GeoImage.d.ts +2 -0
- package/dist/esm/types/core/lib/KernelGenerator.d.ts +31 -0
- package/dist/esm/types/core/lib/TerrainGenerator.d.ts +6 -1
- package/dist/esm/types/core/types.d.ts +19 -12
- package/dist/esm/types/layers/CogTerrainLayer.d.ts +6 -0
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@ declare class CogTiles {
|
|
|
48
48
|
* @returns {number} The index of the image in the COG that best matches the specified zoom level.
|
|
49
49
|
*/
|
|
50
50
|
getImageIndexForZoomLevel(zoom: any): number;
|
|
51
|
-
getTileFromImage(tileX: any, tileY: any, zoom: any, fetchSize?: number): Promise<(
|
|
51
|
+
getTileFromImage(tileX: any, tileY: any, zoom: any, fetchSize?: number): Promise<(Uint8Array<ArrayBuffer> | Int8Array<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float32Array<ArrayBuffer> | Float64Array<ArrayBuffer>)[] | import("geotiff").TypedArrayWithDimensions[]>;
|
|
52
52
|
/**
|
|
53
53
|
* Creates a blank tile buffer filled with the "No Data" value.
|
|
54
54
|
* @param size The width/height of the square tile (e.g., 256 or 257)
|
|
@@ -79,6 +79,6 @@ declare class CogTiles {
|
|
|
79
79
|
* @param {number} multiplier - Optional multiplier for interleaved buffers (e.g., numChannels).
|
|
80
80
|
* @returns {TypedArray} A typed array buffer of length (tileSize * tileSize * multiplier).
|
|
81
81
|
*/
|
|
82
|
-
createTileBuffer(dataType: string, tileSize: number, multiplier?: number):
|
|
82
|
+
createTileBuffer(dataType: string, tileSize: number, multiplier?: number): Uint8Array<ArrayBuffer> | Int8Array<ArrayBuffer> | Int16Array<ArrayBuffer> | Uint16Array<ArrayBuffer> | Int32Array<ArrayBuffer> | Uint32Array<ArrayBuffer> | Float32Array<ArrayBuffer> | Float64Array<ArrayBuffer>;
|
|
83
83
|
}
|
|
84
84
|
export default CogTiles;
|
|
@@ -9,12 +9,14 @@ export default class GeoImage {
|
|
|
9
9
|
height: number;
|
|
10
10
|
rasters: any[];
|
|
11
11
|
bounds: Bounds;
|
|
12
|
+
cellSizeMeters?: number;
|
|
12
13
|
}, options: GeoImageOptions, meshMaxError: any): Promise<TileResult | null>;
|
|
13
14
|
getHeightmap(input: string | {
|
|
14
15
|
bounds: Bounds;
|
|
15
16
|
width: number;
|
|
16
17
|
height: number;
|
|
17
18
|
rasters: any[];
|
|
19
|
+
cellSizeMeters?: number;
|
|
18
20
|
}, options: GeoImageOptions, meshMaxError: any): Promise<TileResult>;
|
|
19
21
|
getBitmap(input: string | {
|
|
20
22
|
width: number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KernelGenerator — 3×3 neighborhood kernel calculations on elevation rasters.
|
|
3
|
+
*
|
|
4
|
+
* Input contract: a Float32Array of 258×258 elevation values (row-major).
|
|
5
|
+
* Edge pixels (row/col 0 and 257) are used only as kernel neighbors and do
|
|
6
|
+
* not appear in the output.
|
|
7
|
+
* Output: Float32Array of 256×256 computed values.
|
|
8
|
+
*/
|
|
9
|
+
export declare class KernelGenerator {
|
|
10
|
+
/**
|
|
11
|
+
* Calculates slope (0–90 degrees) for each pixel using Horn's method.
|
|
12
|
+
*
|
|
13
|
+
* @param src Float32Array of 258×258 elevation values (row-major)
|
|
14
|
+
* @param cellSize Cell size in meters per pixel
|
|
15
|
+
* @param zFactor Vertical exaggeration factor (default 1)
|
|
16
|
+
* @param noDataValue Elevation value treated as noData; output is NaN for those pixels
|
|
17
|
+
*/
|
|
18
|
+
static calculateSlope(src: Float32Array, cellSize: number, zFactor?: number, noDataValue?: number): Float32Array;
|
|
19
|
+
/**
|
|
20
|
+
* Calculates hillshade (0–255 grayscale) for each pixel.
|
|
21
|
+
* Follows the ESRI hillshade algorithm convention.
|
|
22
|
+
*
|
|
23
|
+
* @param src Float32Array of 258×258 elevation values (row-major)
|
|
24
|
+
* @param azimuth Sun azimuth in degrees (default 315 = NW)
|
|
25
|
+
* @param altitude Sun altitude above horizon in degrees (default 45)
|
|
26
|
+
* @param cellSize Cell size in meters per pixel
|
|
27
|
+
* @param zFactor Vertical exaggeration factor (default 1)
|
|
28
|
+
* @param noDataValue Elevation value treated as noData; output is NaN for those pixels
|
|
29
|
+
*/
|
|
30
|
+
static calculateHillshade(src: Float32Array, cellSize: number, azimuth?: number, altitude?: number, zFactor?: number, noDataValue?: number): Float32Array;
|
|
31
|
+
}
|
|
@@ -5,7 +5,12 @@ export declare class TerrainGenerator {
|
|
|
5
5
|
height: number;
|
|
6
6
|
rasters: TypedArray[];
|
|
7
7
|
bounds: Bounds;
|
|
8
|
-
|
|
8
|
+
cellSizeMeters?: number;
|
|
9
|
+
}, options: GeoImageOptions, meshMaxError: number): Promise<TileResult>;
|
|
10
|
+
/** Extracts rows 1–257, cols 1–257 from a 258×258 terrain array → 257×257 for mesh generation. */
|
|
11
|
+
private static extractMeshRaster;
|
|
12
|
+
private static hasVisualizationOptions;
|
|
13
|
+
private static cropRaster;
|
|
9
14
|
/**
|
|
10
15
|
* Decodes raw raster data into a Float32Array of elevation values.
|
|
11
16
|
* Handles channel selection, value scaling, data type validation, and border stitching.
|
|
@@ -6,38 +6,43 @@ export type ClampToTerrainOptions = {
|
|
|
6
6
|
};
|
|
7
7
|
export type GeoImageOptions = {
|
|
8
8
|
type: 'image' | 'terrain';
|
|
9
|
-
tesselator?: 'martini' | 'delatin';
|
|
10
9
|
format?: 'uint8' | 'uint16' | 'uint32' | 'int8' | 'int16' | 'int32' | 'float32' | 'float64';
|
|
10
|
+
/** 1-based index of the channel to visualize (e.g. 1 for the first channel). */
|
|
11
|
+
useChannel?: number | null;
|
|
12
|
+
/** 0-based index of the channel to visualize (e.g. 0 for the first channel). Alternative to useChannel. */
|
|
13
|
+
useChannelIndex?: number | null;
|
|
14
|
+
noDataValue?: number;
|
|
15
|
+
multiplier?: number;
|
|
16
|
+
numOfChannels?: number;
|
|
17
|
+
planarConfig?: number;
|
|
18
|
+
tesselator?: 'martini' | 'delatin';
|
|
19
|
+
terrainColor?: Array<number> | chroma.Color;
|
|
20
|
+
terrainSkirtHeight?: number;
|
|
21
|
+
terrainMinValue?: number;
|
|
11
22
|
useHeatMap?: boolean;
|
|
12
23
|
useColorsBasedOnValues?: boolean;
|
|
13
24
|
useColorClasses?: boolean;
|
|
14
25
|
useAutoRange?: boolean;
|
|
15
26
|
useDataForOpacity?: boolean;
|
|
16
|
-
/** 1-based index of the channel to visualize (e.g. 1 for the first channel). */
|
|
17
|
-
useChannel?: number | null;
|
|
18
|
-
/** 0-based index of the channel to visualize (e.g. 0 for the first channel). Alternative to useChannel. */
|
|
19
|
-
useChannelIndex?: number | null;
|
|
20
27
|
useSingleColor?: boolean;
|
|
21
28
|
blurredTexture?: boolean;
|
|
22
29
|
clipLow?: number | null;
|
|
23
30
|
clipHigh?: number | null;
|
|
24
|
-
multiplier?: number;
|
|
25
31
|
color?: Array<number> | chroma.Color;
|
|
26
32
|
colorScale?: Array<string> | Array<chroma.Color>;
|
|
27
33
|
colorScaleValueRange?: number[];
|
|
28
34
|
colorsBasedOnValues?: [number | undefined, chroma.Color][];
|
|
29
35
|
colorClasses?: [chroma.Color, [number, number], [boolean, boolean]?][];
|
|
30
36
|
alpha?: number;
|
|
31
|
-
noDataValue?: number;
|
|
32
|
-
numOfChannels?: number;
|
|
33
37
|
nullColor?: Array<number> | chroma.Color;
|
|
34
38
|
unidentifiedColor?: Array<number> | chroma.Color;
|
|
35
39
|
clippedColor?: Array<number> | chroma.Color;
|
|
36
40
|
clampToTerrain?: ClampToTerrainOptions | boolean;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
useSlope?: boolean;
|
|
42
|
+
useHillshade?: boolean;
|
|
43
|
+
hillshadeAzimuth?: number;
|
|
44
|
+
hillshadeAltitude?: number;
|
|
45
|
+
zFactor?: number;
|
|
41
46
|
};
|
|
42
47
|
export declare const DefaultGeoImageOptions: GeoImageOptions;
|
|
43
48
|
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
@@ -57,6 +62,8 @@ export type TerrainMesh = {
|
|
|
57
62
|
export interface TileResult {
|
|
58
63
|
map: ImageBitmap | TerrainMesh;
|
|
59
64
|
raw: TypedArray | null;
|
|
65
|
+
rawDerived?: TypedArray | null;
|
|
60
66
|
width: number;
|
|
61
67
|
height: number;
|
|
68
|
+
texture?: ImageBitmap;
|
|
62
69
|
}
|
|
@@ -55,6 +55,12 @@ type _CogTerrainLayerProps = {
|
|
|
55
55
|
terrainOptions: GeoImageOptions;
|
|
56
56
|
/** Pre-initialized CogTiles object for terrain */
|
|
57
57
|
cogTiles?: CogTiles;
|
|
58
|
+
/**
|
|
59
|
+
* When true, suppresses any texture generated by the tile (e.g. heatmap/hillshade)
|
|
60
|
+
* and renders the mesh in the plain `color` instead.
|
|
61
|
+
* Useful for showing a neutral grey terrain during mode transitions.
|
|
62
|
+
*/
|
|
63
|
+
disableTexture?: boolean;
|
|
58
64
|
/**
|
|
59
65
|
* @deprecated Use `loadOptions.terrain.workerUrl` instead
|
|
60
66
|
*/
|