@loaders.gl/raster 5.0.0-beta.4 → 5.0.0-beta.6
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 -1
- package/dist/geotiff/advanced.cjs +4 -4
- package/dist/geotiff/geotiff-loader-types.js +1 -1
- package/dist/geotiff/geotiff-raster-loader-types.js +1 -1
- package/dist/geotiff/geotiff-source-loader.js +1 -1
- package/dist/geotiff/loaders.js +1 -1
- package/dist/geotiff/ometiff-source-loader.js +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lerc/lerc-loader-types.js +1 -1
- package/dist/quantized-mesh-worker.js +3684 -3505
- package/dist/terrain/heightmap.cjs +2 -333
- package/dist/terrain/heightmap.cjs.map +4 -4
- package/dist/terrain/heightmap.d.ts +1 -5
- package/dist/terrain/heightmap.d.ts.map +1 -1
- package/dist/terrain/heightmap.js +0 -3
- package/dist/terrain/heightmap.js.map +1 -1
- package/dist/terrain/index.cjs +41 -82
- package/dist/terrain/index.cjs.map +3 -3
- package/dist/terrain/index.d.ts +1 -2
- package/dist/terrain/index.d.ts.map +1 -1
- package/dist/terrain/index.js.map +1 -1
- package/dist/terrain/lib/helpers/skirt.d.ts +2 -9
- package/dist/terrain/lib/helpers/skirt.d.ts.map +1 -1
- package/dist/terrain/lib/helpers/skirt.js +30 -114
- package/dist/terrain/lib/helpers/skirt.js.map +1 -1
- package/dist/terrain/lib/terrain-contracts.d.ts +0 -15
- package/dist/terrain/lib/terrain-contracts.d.ts.map +1 -1
- package/dist/terrain/lib/utils/version.js +1 -1
- package/dist/terrain/quantized-mesh-loader.js +1 -1
- package/dist/terrain/quantized-mesh-loader.js.map +1 -1
- package/dist/terrain/terrain-loader.js +1 -1
- package/dist/terrain/terrain-loader.js.map +1 -1
- package/dist/terrain-worker.js +788 -457
- package/package.json +5 -17
- package/src/index.ts +0 -7
- package/src/terrain/heightmap.ts +0 -10
- package/src/terrain/index.ts +0 -7
- package/src/terrain/lib/helpers/skirt.ts +41 -151
- package/src/terrain/lib/terrain-contracts.ts +0 -19
- package/src/terrain/quantized-mesh-loader.ts +1 -1
- package/src/terrain/terrain-loader.ts +1 -1
- package/dist/terrain/lib/terrain-height-field.d.ts +0 -51
- package/dist/terrain/lib/terrain-height-field.d.ts.map +0 -1
- package/dist/terrain/lib/terrain-height-field.js +0 -260
- package/dist/terrain/lib/terrain-height-field.js.map +0 -1
- package/dist/terrain/lib/terrain-height-grid.d.ts +0 -14
- package/dist/terrain/lib/terrain-height-grid.d.ts.map +0 -1
- package/dist/terrain/lib/terrain-height-grid.js +0 -104
- package/dist/terrain/lib/terrain-height-grid.js.map +0 -1
- package/dist/terrain/lib/terrain-neighborhood.d.ts +0 -15
- package/dist/terrain/lib/terrain-neighborhood.d.ts.map +0 -1
- package/dist/terrain/lib/terrain-neighborhood.js +0 -58
- package/dist/terrain/lib/terrain-neighborhood.js.map +0 -1
- package/src/terrain/lib/terrain-height-field.ts +0 -355
- package/src/terrain/lib/terrain-height-grid.ts +0 -157
- package/src/terrain/lib/terrain-neighborhood.ts +0 -69
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/raster",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.6",
|
|
4
4
|
"description": "GeoTIFF, OME-TIFF, LERC, and terrain raster loaders",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -239,22 +239,10 @@
|
|
|
239
239
|
"types": "./dist/terrain/lib/terrain-contracts.d.ts",
|
|
240
240
|
"import": "./dist/terrain/lib/terrain-contracts.js"
|
|
241
241
|
},
|
|
242
|
-
"./terrain/lib/terrain-height-field": {
|
|
243
|
-
"types": "./dist/terrain/lib/terrain-height-field.d.ts",
|
|
244
|
-
"import": "./dist/terrain/lib/terrain-height-field.js"
|
|
245
|
-
},
|
|
246
|
-
"./terrain/lib/terrain-height-grid": {
|
|
247
|
-
"types": "./dist/terrain/lib/terrain-height-grid.d.ts",
|
|
248
|
-
"import": "./dist/terrain/lib/terrain-height-grid.js"
|
|
249
|
-
},
|
|
250
242
|
"./terrain/lib/terrain-heightmap-types": {
|
|
251
243
|
"types": "./dist/terrain/lib/terrain-heightmap-types.d.ts",
|
|
252
244
|
"import": "./dist/terrain/lib/terrain-heightmap-types.js"
|
|
253
245
|
},
|
|
254
|
-
"./terrain/lib/terrain-neighborhood": {
|
|
255
|
-
"types": "./dist/terrain/lib/terrain-neighborhood.d.ts",
|
|
256
|
-
"import": "./dist/terrain/lib/terrain-neighborhood.js"
|
|
257
|
-
},
|
|
258
246
|
"./terrain/lib/utils/version": {
|
|
259
247
|
"types": "./dist/terrain/lib/utils/version.d.ts",
|
|
260
248
|
"import": "./dist/terrain/lib/utils/version.js"
|
|
@@ -325,9 +313,9 @@
|
|
|
325
313
|
"pre-build": "npm run copy-libs && node ./build-cjs.mjs && npm run build-worker-terrain && npm run build-worker-quantized-mesh"
|
|
326
314
|
},
|
|
327
315
|
"dependencies": {
|
|
328
|
-
"@loaders.gl/documents": "5.0.0-beta.
|
|
329
|
-
"@loaders.gl/images": "5.0.0-beta.
|
|
330
|
-
"@math.gl/geospatial": "5.0.0-beta.
|
|
316
|
+
"@loaders.gl/documents": "5.0.0-beta.6",
|
|
317
|
+
"@loaders.gl/images": "5.0.0-beta.6",
|
|
318
|
+
"@math.gl/geospatial": "5.0.0-beta.6"
|
|
331
319
|
},
|
|
332
320
|
"peerDependencies": {
|
|
333
321
|
"@loaders.gl/core": "~5.0.0-alpha.0",
|
|
@@ -372,5 +360,5 @@
|
|
|
372
360
|
"terrain",
|
|
373
361
|
"tif"
|
|
374
362
|
],
|
|
375
|
-
"gitHead": "
|
|
363
|
+
"gitHead": "9f51365702efd62aa5bae5f9c2880260503d76bd"
|
|
376
364
|
}
|
package/src/index.ts
CHANGED
|
@@ -33,8 +33,6 @@ export type {
|
|
|
33
33
|
TerrainHeightmapImage
|
|
34
34
|
} from './terrain/lib/terrain-heightmap-types';
|
|
35
35
|
export type {
|
|
36
|
-
TerrainGridMetadata,
|
|
37
|
-
TerrainHeightGrid,
|
|
38
36
|
TerrainRay,
|
|
39
37
|
TerrainSurfaceHit,
|
|
40
38
|
TerrainSurfaceBounds,
|
|
@@ -44,11 +42,6 @@ export {GeoTIFFSourceLoader} from './geotiff/geotiff-source-loader-types';
|
|
|
44
42
|
export {OMETiffSourceLoader} from './geotiff/ometiff-source-loader-types';
|
|
45
43
|
export type {GeoTIFFSourceLoaderOptions} from './geotiff/geotiff-source-loader';
|
|
46
44
|
export type {OMETiffSourceLoaderOptions} from './geotiff/ometiff-source-loader';
|
|
47
|
-
export type {
|
|
48
|
-
TerrainFieldBounds,
|
|
49
|
-
TerrainHeightFieldOptions,
|
|
50
|
-
TerrainHeightFieldStatistics
|
|
51
|
-
} from './terrain/lib/terrain-height-field';
|
|
52
45
|
export type {
|
|
53
46
|
GetOMETiffParameters,
|
|
54
47
|
OMETiffChannelMetadata,
|
package/src/terrain/heightmap.ts
CHANGED
|
@@ -13,18 +13,8 @@ export {
|
|
|
13
13
|
} from './lib/decode-terrain-heightmap';
|
|
14
14
|
|
|
15
15
|
export type {
|
|
16
|
-
TerrainGridMetadata,
|
|
17
|
-
TerrainHeightGrid,
|
|
18
16
|
TerrainRay,
|
|
19
17
|
TerrainSurfaceHit,
|
|
20
18
|
TerrainSurfaceBounds,
|
|
21
19
|
TerrainSurface
|
|
22
20
|
} from './lib/terrain-contracts';
|
|
23
|
-
export {createTerrainHeightGrid, sampleTerrainHeightGrid} from './lib/terrain-height-grid';
|
|
24
|
-
export {TerrainHeightField} from './lib/terrain-height-field';
|
|
25
|
-
export type {
|
|
26
|
-
TerrainFieldBounds,
|
|
27
|
-
TerrainHeightFieldOptions,
|
|
28
|
-
TerrainHeightFieldStatistics
|
|
29
|
-
} from './lib/terrain-height-field';
|
|
30
|
-
export {sampleTerrainNeighborhood, resampleTerrainNodes} from './lib/terrain-neighborhood';
|
package/src/terrain/index.ts
CHANGED
|
@@ -4,13 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
export type {TerrainLoaderOptions} from './terrain-loader-types';
|
|
6
6
|
export type {
|
|
7
|
-
TerrainFieldBounds,
|
|
8
|
-
TerrainHeightFieldOptions,
|
|
9
|
-
TerrainHeightFieldStatistics
|
|
10
|
-
} from './lib/terrain-height-field';
|
|
11
|
-
export type {
|
|
12
|
-
TerrainGridMetadata,
|
|
13
|
-
TerrainHeightGrid,
|
|
14
7
|
TerrainRay,
|
|
15
8
|
TerrainSurfaceHit,
|
|
16
9
|
TerrainSurfaceBounds,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {createTerrainSkirt} from '@math.gl/geospatial/terrain';
|
|
6
6
|
|
|
7
7
|
export type EdgeIndices = {
|
|
8
8
|
westIndices: number[];
|
|
@@ -11,162 +11,52 @@ export type EdgeIndices = {
|
|
|
11
11
|
southIndices: number[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
* Add skirt to existing mesh
|
|
16
|
-
* @param {object} attributes - POSITION and TEXCOOD_0 attributes data
|
|
17
|
-
* @param {any} triangles - indices array of the mesh geometry
|
|
18
|
-
* @param skirtHeight - height of the skirt geometry
|
|
19
|
-
* @param outsideIndices - edge indices from quantized mesh data
|
|
20
|
-
* @returns - geometry data with added skirt
|
|
21
|
-
*/
|
|
14
|
+
/** Add a visual skirt while retaining the loader's texture coordinates and index representation. */
|
|
22
15
|
export function addSkirt(attributes, triangles, skirtHeight: number, outsideIndices?: EdgeIndices) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
skirtHeight,
|
|
42
|
-
newPosition,
|
|
43
|
-
newTexcoord0,
|
|
44
|
-
newTriangles
|
|
45
|
-
});
|
|
16
|
+
const positions = attributes.POSITION.value;
|
|
17
|
+
const sourceIndices = Array.isArray(triangles) ? Uint32Array.from(triangles) : triangles;
|
|
18
|
+
const edges = outsideIndices ? getBoundaryEdges(outsideIndices, positions) : undefined;
|
|
19
|
+
const skirt = createTerrainSkirt(
|
|
20
|
+
{positions, indices: sourceIndices},
|
|
21
|
+
{height: skirtHeight, edges}
|
|
22
|
+
);
|
|
23
|
+
const textureCoordinates = attributes.TEXCOORD_0.value;
|
|
24
|
+
const outputTextureCoordinates = new textureCoordinates.constructor(
|
|
25
|
+
(skirt.positions.length / 3) * 2
|
|
26
|
+
);
|
|
27
|
+
outputTextureCoordinates.set(textureCoordinates);
|
|
28
|
+
for (let i = 0; i < skirt.sourceVertexIndices.length; i++) {
|
|
29
|
+
const source = skirt.sourceVertexIndices[i];
|
|
30
|
+
outputTextureCoordinates.set(
|
|
31
|
+
textureCoordinates.subarray(source * 2, source * 2 + 2),
|
|
32
|
+
(skirt.skirtVertexOffset + i) * 2
|
|
33
|
+
);
|
|
46
34
|
}
|
|
47
|
-
|
|
48
|
-
attributes.
|
|
49
|
-
attributes.TEXCOORD_0.value = concatenateTypedArrays(attributes.TEXCOORD_0.value, newTexcoord0);
|
|
50
|
-
const resultTriangles =
|
|
51
|
-
triangles instanceof Array
|
|
52
|
-
? triangles.concat(newTriangles)
|
|
53
|
-
: concatenateTypedArrays(triangles, newTriangles);
|
|
54
|
-
|
|
35
|
+
attributes.POSITION.value = skirt.positions;
|
|
36
|
+
attributes.TEXCOORD_0.value = outputTextureCoordinates;
|
|
55
37
|
return {
|
|
56
38
|
attributes,
|
|
57
|
-
triangles:
|
|
39
|
+
triangles: Array.isArray(triangles) ? Array.from(skirt.indices) : skirt.indices
|
|
58
40
|
};
|
|
59
41
|
}
|
|
60
42
|
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
while (index < edges.length) {
|
|
79
|
-
if (edges[index][0] === edges[index + 1]?.[1] && edges[index][1] === edges[index + 1]?.[0]) {
|
|
80
|
-
index += 2;
|
|
81
|
-
} else {
|
|
82
|
-
outsideEdges.push(edges[index]);
|
|
83
|
-
index++;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return outsideEdges;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Get geometry edges that located on a border of the mesh
|
|
91
|
-
* @param {object} indices - edge indices from quantized mesh data
|
|
92
|
-
* @param {TypedArray} position - position attribute geometry data
|
|
93
|
-
* @returns {number[][]} - outside edges data
|
|
94
|
-
*/
|
|
95
|
-
function getOutsideEdgesFromIndices(indices: EdgeIndices, position) {
|
|
96
|
-
// Sort skirt indices to create adjacent triangles
|
|
97
|
-
indices.westIndices.sort((a, b) => position[3 * a + 1] - position[3 * b + 1]);
|
|
98
|
-
// Reverse (b - a) to match triangle winding
|
|
99
|
-
indices.eastIndices.sort((a, b) => position[3 * b + 1] - position[3 * a + 1]);
|
|
100
|
-
indices.southIndices.sort((a, b) => position[3 * b] - position[3 * a]);
|
|
101
|
-
// Reverse (b - a) to match triangle winding
|
|
102
|
-
indices.northIndices.sort((a, b) => position[3 * a] - position[3 * b]);
|
|
103
|
-
|
|
104
|
-
const edges: number[][] = [];
|
|
105
|
-
for (const index in indices) {
|
|
106
|
-
const indexGroup = indices[index];
|
|
107
|
-
for (let i = 0; i < indexGroup.length - 1; i++) {
|
|
108
|
-
edges.push([indexGroup[i], indexGroup[i + 1]]);
|
|
109
|
-
}
|
|
43
|
+
/** Translate quantized mesh side lists into selected boundary edge pairs. */
|
|
44
|
+
function getBoundaryEdges(
|
|
45
|
+
indices: EdgeIndices,
|
|
46
|
+
positions: Float32Array | Float64Array
|
|
47
|
+
): Uint32Array {
|
|
48
|
+
indices.westIndices.sort((a, b) => positions[3 * a + 1] - positions[3 * b + 1]);
|
|
49
|
+
indices.eastIndices.sort((a, b) => positions[3 * b + 1] - positions[3 * a + 1]);
|
|
50
|
+
indices.southIndices.sort((a, b) => positions[3 * b] - positions[3 * a]);
|
|
51
|
+
indices.northIndices.sort((a, b) => positions[3 * a] - positions[3 * b]);
|
|
52
|
+
const edges: number[] = [];
|
|
53
|
+
for (const side of [
|
|
54
|
+
indices.westIndices,
|
|
55
|
+
indices.northIndices,
|
|
56
|
+
indices.eastIndices,
|
|
57
|
+
indices.southIndices
|
|
58
|
+
]) {
|
|
59
|
+
for (let i = 1; i < side.length; i++) edges.push(side[i - 1], side[i]);
|
|
110
60
|
}
|
|
111
|
-
return edges;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Get geometry edges that located on a border of the mesh
|
|
116
|
-
* @param {object} args
|
|
117
|
-
* @param {number[]} args.edge - edge indices in geometry
|
|
118
|
-
* @param {number} args.edgeIndex - edge index in outsideEdges array
|
|
119
|
-
* @param {object} args.attributes - POSITION and TEXCOORD_0 attributes
|
|
120
|
-
* @param {number} args.skirtHeight - height of the skirt geometry
|
|
121
|
-
* @param {TypedArray} args.newPosition - POSITION array for skirt data
|
|
122
|
-
* @param {TypedArray} args.newTexcoord0 - TEXCOORD_0 array for skirt data
|
|
123
|
-
* @param {TypedArray | Array} args.newTriangles - trinagle indices array for skirt data
|
|
124
|
-
* @returns {void}
|
|
125
|
-
*/
|
|
126
|
-
function updateAttributesForNewEdge({
|
|
127
|
-
edge,
|
|
128
|
-
edgeIndex,
|
|
129
|
-
attributes,
|
|
130
|
-
skirtHeight,
|
|
131
|
-
newPosition,
|
|
132
|
-
newTexcoord0,
|
|
133
|
-
newTriangles
|
|
134
|
-
}) {
|
|
135
|
-
const positionsLength = attributes.POSITION.value.length;
|
|
136
|
-
const vertex1Offset = edgeIndex * 2;
|
|
137
|
-
const vertex2Offset = edgeIndex * 2 + 1;
|
|
138
|
-
|
|
139
|
-
// Define POSITION for new 1st vertex
|
|
140
|
-
newPosition.set(
|
|
141
|
-
attributes.POSITION.value.subarray(edge[0] * 3, edge[0] * 3 + 3),
|
|
142
|
-
vertex1Offset * 3
|
|
143
|
-
);
|
|
144
|
-
newPosition[vertex1Offset * 3 + 2] = newPosition[vertex1Offset * 3 + 2] - skirtHeight; // put down elevation on the skirt height
|
|
145
|
-
|
|
146
|
-
// Define POSITION for new 2nd vertex
|
|
147
|
-
newPosition.set(
|
|
148
|
-
attributes.POSITION.value.subarray(edge[1] * 3, edge[1] * 3 + 3),
|
|
149
|
-
vertex2Offset * 3
|
|
150
|
-
);
|
|
151
|
-
newPosition[vertex2Offset * 3 + 2] = newPosition[vertex2Offset * 3 + 2] - skirtHeight; // put down elevation on the skirt height
|
|
152
|
-
|
|
153
|
-
// Use same TEXCOORDS for skirt vertices
|
|
154
|
-
newTexcoord0.set(
|
|
155
|
-
attributes.TEXCOORD_0.value.subarray(edge[0] * 2, edge[0] * 2 + 2),
|
|
156
|
-
vertex1Offset * 2
|
|
157
|
-
);
|
|
158
|
-
newTexcoord0.set(
|
|
159
|
-
attributes.TEXCOORD_0.value.subarray(edge[1] * 2, edge[1] * 2 + 2),
|
|
160
|
-
vertex2Offset * 2
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
// Define new triangles
|
|
164
|
-
const triangle1Offset = edgeIndex * 2 * 3;
|
|
165
|
-
newTriangles[triangle1Offset] = edge[0];
|
|
166
|
-
newTriangles[triangle1Offset + 1] = positionsLength / 3 + vertex2Offset;
|
|
167
|
-
newTriangles[triangle1Offset + 2] = edge[1];
|
|
168
|
-
|
|
169
|
-
newTriangles[triangle1Offset + 3] = positionsLength / 3 + vertex2Offset;
|
|
170
|
-
newTriangles[triangle1Offset + 4] = edge[0];
|
|
171
|
-
newTriangles[triangle1Offset + 5] = positionsLength / 3 + vertex1Offset;
|
|
61
|
+
return Uint32Array.from(edges);
|
|
172
62
|
}
|
|
@@ -2,25 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {TerrainHeightmap} from './terrain-heightmap-types';
|
|
6
|
-
|
|
7
|
-
/** Georeferencing supplied by a source, never inferred from a provider name. */
|
|
8
|
-
export type TerrainGridMetadata = {
|
|
9
|
-
/** West, south, east, north in unwrapped EPSG:3857 meters; row zero is north. */
|
|
10
|
-
readonly bounds: readonly [number, number, number, number];
|
|
11
|
-
/** Pixel centers or samples including both footprint edges. */
|
|
12
|
-
readonly registration: 'pixel-center' | 'grid-node';
|
|
13
|
-
/** Physical height reference; this API does not convert vertical datums. */
|
|
14
|
-
readonly verticalDatum: 'ellipsoidal' | 'orthometric' | 'unknown';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/** Physical source meters, independent of projection, display relief and mesh resolution. */
|
|
18
|
-
export type TerrainHeightGrid = TerrainHeightmap &
|
|
19
|
-
TerrainGridMetadata & {
|
|
20
|
-
/** One byte per sample: zero is missing; invalid heights are NaN. Alpha is not inferred. */
|
|
21
|
-
readonly valid: Uint8Array;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
5
|
/** Ray coordinates must match the queried surface; direction need not be normalized. */
|
|
25
6
|
export type TerrainRay = {
|
|
26
7
|
/** Absolute content-space origin, before camera or room-placement transforms. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
serializeArrowWorkerResult,
|
|
7
7
|
deserializeArrowWorkerResult
|
|
8
|
-
} from '@loaders.gl/core/
|
|
8
|
+
} from '@loaders.gl/core/arrow-worker-transport';
|
|
9
9
|
import type {LoaderWithParser} from '@loaders.gl/core/loader-utils';
|
|
10
10
|
import type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';
|
|
11
11
|
import {convertMeshToTable, convertTableToMesh} from '@loaders.gl/core/schema-utils';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
serializeArrowWorkerResult,
|
|
7
7
|
deserializeArrowWorkerResult
|
|
8
|
-
} from '@loaders.gl/core/
|
|
8
|
+
} from '@loaders.gl/core/arrow-worker-transport';
|
|
9
9
|
import type {LoaderContext, LoaderWithParser} from '@loaders.gl/core/loader-utils';
|
|
10
10
|
import {parseFromContext} from '@loaders.gl/core/loader-utils';
|
|
11
11
|
import type {Mesh, MeshArrowTable} from '@loaders.gl/core/schema';
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { TerrainHeightGrid } from "./terrain-contracts.js";
|
|
2
|
-
/** Absolute EPSG:3857 [west, south, east, north], including zero-width probe bounds. */
|
|
3
|
-
export type TerrainFieldBounds = readonly [number, number, number, number];
|
|
4
|
-
/** Retained mask admission; geometry, source arrays and JavaScript metadata are separate. */
|
|
5
|
-
export interface TerrainHeightFieldOptions {
|
|
6
|
-
/** Maximum retained summed-area mask bytes; default 8 MiB. Zero uses exact sample scans. */
|
|
7
|
-
maxMaskBytes?: number;
|
|
8
|
-
}
|
|
9
|
-
/** Detached operation counts, suitable for deterministic performance tests rather than FPS estimates. */
|
|
10
|
-
export interface TerrainHeightFieldStatistics {
|
|
11
|
-
/** Number of retained immutable source references. */
|
|
12
|
-
grids: number;
|
|
13
|
-
/** Retained summed-area mask bytes, excluding source arrays and tree metadata. */
|
|
14
|
-
maskBytes: number;
|
|
15
|
-
/** Admitted mask constructions, each built at most once per grid. */
|
|
16
|
-
maskBuilds: number;
|
|
17
|
-
/** Validity samples read during mask construction or exact fallback scans. */
|
|
18
|
-
maskSamples: number;
|
|
19
|
-
/** Spatial tree envelopes tested by sampling and coverage queries. */
|
|
20
|
-
boundsTests: number;
|
|
21
|
-
/** Candidate grid footprints visited after tree pruning. */
|
|
22
|
-
candidateGrids: number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Immutable-source physical height sampling and conservative footprint admission.
|
|
26
|
-
* Snapshots membership/bounds, not height arrays: do not mutate shared grids.
|
|
27
|
-
* No provider, worker, deck view, GPU resource or implicit longitude wrapping is owned.
|
|
28
|
-
*/
|
|
29
|
-
export declare class TerrainHeightField {
|
|
30
|
-
/** Original order for small-field direct sampling, avoiding tree/sort overhead. */
|
|
31
|
-
private readonly entries;
|
|
32
|
-
/** Immutable spatial tree built once per admitted field. */
|
|
33
|
-
private readonly root;
|
|
34
|
-
/** Fixed retained summed-area mask admission limit. */
|
|
35
|
-
private readonly maxMaskBytes;
|
|
36
|
-
/** Mutable counters never exposed by reference. */
|
|
37
|
-
private readonly statistics;
|
|
38
|
-
/** Retain structurally valid decoded grids with one datum; overlaps preserve ordered sample averaging. */
|
|
39
|
-
constructor(grids: readonly TerrainHeightGrid[], options?: TerrainHeightFieldOptions);
|
|
40
|
-
/** Sample physical meters in original source order; any contributing no-data support remains a hole. */
|
|
41
|
-
sampleHeight(position: readonly [number, number]): number | null;
|
|
42
|
-
/** Require complete rectangular footprint coverage and no invalid bilinear-support sample; not an exact triangle mask. */
|
|
43
|
-
coversBounds(bounds: TerrainFieldBounds): boolean;
|
|
44
|
-
/** Scalar counters only; callers cannot mutate cache ownership through diagnostics. */
|
|
45
|
-
getStatistics(): TerrainHeightFieldStatistics;
|
|
46
|
-
/** Traverse closed envelopes, then preserve original source order for floating-point accumulation. */
|
|
47
|
-
private findEntries;
|
|
48
|
-
/** Admit a lazy reusable prefix or scan the same support rectangle exactly when it does not fit. */
|
|
49
|
-
private hasMissingSamples;
|
|
50
|
-
}
|
|
51
|
-
//# sourceMappingURL=terrain-height-field.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"terrain-height-field.d.ts","sourceRoot":"","sources":["../../../src/terrain/lib/terrain-height-field.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,iBAAiB,EAAC,+BAA4B;AAE3D,wFAAwF;AACxF,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3E,6FAA6F;AAC7F,MAAM,WAAW,yBAAyB;IACxC,4FAA4F;IAC5F,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,yGAAyG;AACzG,MAAM,WAAW,4BAA4B;IAC3C,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,cAAc,EAAE,MAAM,CAAC;CACxB;AA0BD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC7B,mFAAmF;IACnF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IACxC,uDAAuD;IACvD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,mDAAmD;IACnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA+B;IAE1D,0GAA0G;gBAC9F,KAAK,EAAE,SAAS,iBAAiB,EAAE,EAAE,OAAO,GAAE,yBAA8B;IA8CxF,wGAAwG;IACxG,YAAY,CAAC,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IAuBhE,0HAA0H;IAC1H,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO;IA4EjD,uFAAuF;IACvF,aAAa,IAAI,4BAA4B;IAI7C,sGAAsG;IACtG,OAAO,CAAC,WAAW;IAenB,oGAAoG;IACpG,OAAO,CAAC,iBAAiB;CAsE1B"}
|