@gisatcz/deckgl-geolib 1.12.0-dev.1 → 1.12.0-dev.3
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/dist/cjs/index.js +3374 -13043
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +3 -4
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/types/cogbitmaplayer/CogBitmapLayer.d.ts +1 -3
- package/dist/cjs/types/cogtiles/cogtiles.d.ts +102 -16
- package/dist/cjs/types/geoimage/geoimage.d.ts +1 -0
- package/dist/esm/index.js +3374 -13043
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +3 -4
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/types/cogbitmaplayer/CogBitmapLayer.d.ts +1 -3
- package/dist/esm/types/cogtiles/cogtiles.d.ts +102 -16
- package/dist/esm/types/geoimage/geoimage.d.ts +1 -0
- package/package.json +1 -2
- package/src/cogbitmaplayer/CogBitmapLayer.ts +17 -6
- package/src/cogterrainlayer/CogTerrainLayer.ts +2 -2
- package/src/cogtiles/cogtiles.ts +319 -215
- package/src/geoimage/geoimage.ts +8 -6
|
@@ -65,9 +65,7 @@ export default class CogBitmapLayer<ExtraPropsT extends {} = {}> extends Composi
|
|
|
65
65
|
getTileData: any;
|
|
66
66
|
renderSubLayers: any;
|
|
67
67
|
updateTriggers: {
|
|
68
|
-
getTileData:
|
|
69
|
-
clampToTerrain: boolean | ClampToTerrainOptions;
|
|
70
|
-
};
|
|
68
|
+
getTileData: (boolean | GeoImageOptions | ClampToTerrainOptions)[];
|
|
71
69
|
};
|
|
72
70
|
extent: any;
|
|
73
71
|
tileSize: any;
|
|
@@ -1,29 +1,115 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import LZWDecoder from './lzw';
|
|
1
|
+
import { GeoTIFF, GeoTIFFImage } from 'geotiff';
|
|
3
2
|
import GeoImage, { GeoImageOptions } from '../geoimage/geoimage.ts';
|
|
4
3
|
export type Bounds = [minX: number, minY: number, maxX: number, maxY: number];
|
|
5
4
|
declare class CogTiles {
|
|
6
|
-
cog:
|
|
5
|
+
cog: GeoTIFF;
|
|
6
|
+
cogZoomLookup: number[];
|
|
7
|
+
cogResolutionLookup: number[];
|
|
8
|
+
cogOrigin: number[];
|
|
7
9
|
zoomRange: number[];
|
|
8
10
|
tileSize: number;
|
|
9
|
-
|
|
10
|
-
lowestOriginTileSize: number;
|
|
11
|
+
bounds: Bounds;
|
|
11
12
|
loaded: boolean;
|
|
12
13
|
geo: GeoImage;
|
|
13
|
-
lzw: LZWDecoder;
|
|
14
14
|
options: GeoImageOptions;
|
|
15
15
|
constructor(options: GeoImageOptions);
|
|
16
|
-
initializeCog(url: string): Promise<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
getOriginAsLatLon(cog: Tiff): number[];
|
|
21
|
-
getImageTileIndex(img: TiffImage): number[];
|
|
22
|
-
getResolutionFromZoomLevel(tileSize: number, z: number): number;
|
|
16
|
+
initializeCog(url: string): Promise<void>;
|
|
17
|
+
getZoomRange(): number[];
|
|
18
|
+
calculateZoomRange(img: GeoTIFFImage, imgCount: number): number[];
|
|
19
|
+
calculateBoundsAsLatLon(image: GeoTIFFImage): [number, number, number, number];
|
|
23
20
|
getZoomLevelFromResolution(tileSize: number, resolution: number): number;
|
|
21
|
+
getBoundsAsLatLon(): Bounds;
|
|
24
22
|
getLatLon(input: number[]): number[];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Builds lookup tables for zoom levels and estimated resolutions from a Cloud Optimized GeoTIFF (COG) object.
|
|
25
|
+
*
|
|
26
|
+
* It is assumed that inn web mapping, COG data is visualized in the Web Mercator coordinate system.
|
|
27
|
+
* At zoom level 0, the Web Mercator resolution is defined by the constant `webMercatorRes0`
|
|
28
|
+
* (e.g., 156543.03125 m/pixel). At each subsequent zoom level, this resolution is halved.
|
|
29
|
+
*
|
|
30
|
+
* This function calculates, for each image (overview) in the COG, its estimated resolution and
|
|
31
|
+
* corresponding zoom level based on the base image's resolution and width.
|
|
32
|
+
*
|
|
33
|
+
* @param {object} cog - A Cloud Optimized GeoTIFF object loaded via geotiff.js.
|
|
34
|
+
* @returns {Promise<[number[], number[]]>} A promise resolving to a tuple of two arrays:
|
|
35
|
+
* - The first array (`zoomLookup`) maps each image index to its computed zoom level.
|
|
36
|
+
* - The second array (`resolutionLookup`) maps each image index to its estimated resolution (m/pixel).
|
|
37
|
+
*/
|
|
38
|
+
buildCogZoomResolutionLookup(cog: any): Promise<any[][]>;
|
|
39
|
+
/**
|
|
40
|
+
* Determines the appropriate image index from the Cloud Optimized GeoTIFF (COG)
|
|
41
|
+
* that best matches a given zoom level.
|
|
42
|
+
*
|
|
43
|
+
* This function utilizes precomputed lookup tables (`cogZoomLookup`) that map
|
|
44
|
+
* each image index in the COG to its corresponding zoom level. It ensures that
|
|
45
|
+
* the selected image index provides the closest resolution to the desired zoom level.
|
|
46
|
+
*
|
|
47
|
+
* @param {number} zoom - The target zoom level for which the image index is sought.
|
|
48
|
+
* @returns {number} The index of the image in the COG that best matches the specified zoom level.
|
|
49
|
+
*/
|
|
50
|
+
getImageIndexForZoomLevel(zoom: any): number;
|
|
51
|
+
getTileFromImage(tileX: any, tileY: any, zoom: any): Promise<any[][] | import("geotiff").ReadRasterResult[]>;
|
|
52
|
+
getTile(x: number, y: number, z: number, bounds: Bounds, meshMaxError: number): Promise<string | {
|
|
53
|
+
loaderData: {
|
|
54
|
+
header: {};
|
|
55
|
+
};
|
|
56
|
+
header: {
|
|
57
|
+
vertexCount: any;
|
|
58
|
+
boundingBox: [[number, number, number], [number, number, number]];
|
|
59
|
+
};
|
|
60
|
+
mode: number;
|
|
61
|
+
indices: {
|
|
62
|
+
value: Uint32Array;
|
|
63
|
+
size: number;
|
|
64
|
+
};
|
|
65
|
+
attributes: {
|
|
66
|
+
POSITION: {
|
|
67
|
+
value: Float32Array;
|
|
68
|
+
size: number;
|
|
69
|
+
};
|
|
70
|
+
TEXCOORD_0: {
|
|
71
|
+
value: Float32Array;
|
|
72
|
+
size: number;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Determines the data type (e.g., "Int32", "Float64") of a GeoTIFF image
|
|
78
|
+
* by reading its TIFF tags.
|
|
79
|
+
*
|
|
80
|
+
* @param {GeoTIFFImage} image - A GeoTIFF.js image.
|
|
81
|
+
* @returns {Promise<string>} - A string representing the data type.
|
|
82
|
+
*/
|
|
83
|
+
getDataTypeFromTags(image: any): string;
|
|
84
|
+
/**
|
|
85
|
+
* Extracts the noData value from a GeoTIFF.js image.
|
|
86
|
+
* Returns the noData value as a number if available, otherwise undefined.
|
|
87
|
+
*
|
|
88
|
+
* @param {GeoTIFFImage} image - The GeoTIFF.js image.
|
|
89
|
+
* @returns {number|undefined} The noData value as a number, or undefined if not available.
|
|
90
|
+
*/
|
|
91
|
+
getNoDataValue(image: any): number;
|
|
92
|
+
/**
|
|
93
|
+
* Retrieves the number of channels (samples per pixel) in a GeoTIFF image.
|
|
94
|
+
*
|
|
95
|
+
* @param {GeoTIFFImage} image - A GeoTIFFImage object from which to extract the number of channels.
|
|
96
|
+
* @returns {number} The number of channels in the image.
|
|
97
|
+
*/
|
|
98
|
+
getNumberOfChannels(image: any): any;
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves the PlanarConfiguration value from a GeoTIFF image.
|
|
101
|
+
*
|
|
102
|
+
* @param {GeoTIFFImage} image - The GeoTIFF image object.
|
|
103
|
+
* @returns {number} The PlanarConfiguration value (1 for Chunky format, 2 for Planar format).
|
|
104
|
+
*/
|
|
105
|
+
getPlanarConfiguration(image: any): any;
|
|
106
|
+
/**
|
|
107
|
+
* Creates a tile buffer of the specified size using a typed array corresponding to the provided data type.
|
|
108
|
+
*
|
|
109
|
+
* @param {string} dataType - A string specifying the data type (e.g., "Int32", "Float64", "UInt16", etc.).
|
|
110
|
+
* @param {number} tileSize - The width/height of the square tile.
|
|
111
|
+
* @returns {TypedArray} A typed array buffer of length tileSize * tileSize.
|
|
112
|
+
*/
|
|
113
|
+
createTileBuffer(dataType: any, tileSize: any): Uint32Array | Float32Array | Uint8Array | Int8Array | Uint16Array | Int16Array | Int32Array | Float64Array;
|
|
28
114
|
}
|
|
29
115
|
export default CogTiles;
|
|
@@ -34,6 +34,7 @@ export type GeoImageOptions = {
|
|
|
34
34
|
terrainColor?: Array<number> | chroma.Color;
|
|
35
35
|
terrainSkirtHeight?: number;
|
|
36
36
|
terrainMinValue?: number;
|
|
37
|
+
planarConfig?: number;
|
|
37
38
|
};
|
|
38
39
|
export declare const DefaultGeoImageOptions: GeoImageOptions;
|
|
39
40
|
export default class GeoImage {
|