@loaders.gl/tiles 5.0.0-alpha.2 → 5.0.0-alpha.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/LICENSE +1 -1
- package/dist/dist.dev.js +17325 -5650
- package/dist/dist.min.js +4 -1
- package/dist/index.cjs +1924 -178
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/point-cloud/point-cloud-tileset.d.ts +4 -0
- package/dist/point-cloud/point-cloud-tileset.d.ts.map +1 -1
- package/dist/point-cloud/point-cloud-tileset.js +51 -12
- package/dist/point-cloud/point-cloud-tileset.js.map +1 -1
- package/dist/point-cloud/types.d.ts +17 -0
- package/dist/point-cloud/types.d.ts.map +1 -1
- package/dist/raster-set.d.ts +10 -8
- package/dist/raster-set.d.ts.map +1 -1
- package/dist/raster-set.js +18 -1
- package/dist/raster-set.js.map +1 -1
- package/dist/spatial/format-spatial-reference.d.ts +67 -0
- package/dist/spatial/format-spatial-reference.d.ts.map +1 -0
- package/dist/spatial/format-spatial-reference.js +233 -0
- package/dist/spatial/format-spatial-reference.js.map +1 -0
- package/dist/spatial/get-spatial-coordinate-frame.d.ts +9 -0
- package/dist/spatial/get-spatial-coordinate-frame.d.ts.map +1 -0
- package/dist/spatial/get-spatial-coordinate-frame.js +58 -0
- package/dist/spatial/get-spatial-coordinate-frame.js.map +1 -0
- package/dist/spatial/i3s-elevation.d.ts +20 -0
- package/dist/spatial/i3s-elevation.d.ts.map +1 -0
- package/dist/spatial/i3s-elevation.js +90 -0
- package/dist/spatial/i3s-elevation.js.map +1 -0
- package/dist/spatial/i3s-spatial-transformer.d.ts +189 -0
- package/dist/spatial/i3s-spatial-transformer.d.ts.map +1 -0
- package/dist/spatial/i3s-spatial-transformer.js +686 -0
- package/dist/spatial/i3s-spatial-transformer.js.map +1 -0
- package/dist/spatial/spatial-coordinate-transformer.d.ts +48 -0
- package/dist/spatial/spatial-coordinate-transformer.d.ts.map +1 -0
- package/dist/spatial/spatial-coordinate-transformer.js +211 -0
- package/dist/spatial/spatial-coordinate-transformer.js.map +1 -0
- package/dist/spatial/spatial-resource-registry.d.ts +44 -0
- package/dist/spatial/spatial-resource-registry.d.ts.map +1 -0
- package/dist/spatial/spatial-resource-registry.js +67 -0
- package/dist/spatial/spatial-resource-registry.js.map +1 -0
- package/dist/spatial/spatial-types.d.ts +190 -0
- package/dist/spatial/spatial-types.d.ts.map +1 -0
- package/dist/spatial/spatial-types.js +192 -0
- package/dist/spatial/spatial-types.js.map +1 -0
- package/dist/tileset-3d/common/tile-3d.d.ts +49 -1
- package/dist/tileset-3d/common/tile-3d.d.ts.map +1 -1
- package/dist/tileset-3d/common/tile-3d.js +132 -64
- package/dist/tileset-3d/common/tile-3d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.d.ts +25 -0
- package/dist/tileset-3d/common/tileset-3d.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.js +49 -7
- package/dist/tileset-3d/common/tileset-3d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-source.d.ts +14 -0
- package/dist/tileset-3d/common/tileset-source.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-source.js.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts +6 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.js +11 -6
- package/dist/tileset-3d/common/tileset-traverser.js.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts +26 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.d.ts.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js +62 -18
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts +1 -7
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.d.ts.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js +32 -55
- package/dist/tileset-3d/format-3d-tiles/tiles-3d-source.js.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts +14 -1
- package/dist/tileset-3d/format-i3s/i3s-source.d.ts.map +1 -1
- package/dist/tileset-3d/format-i3s/i3s-source.js +107 -17
- package/dist/tileset-3d/format-i3s/i3s-source.js.map +1 -1
- package/dist/tileset-3d/helpers/bounding-volume.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/bounding-volume.js +3 -33
- package/dist/tileset-3d/helpers/bounding-volume.js.map +1 -1
- package/dist/tileset-3d/helpers/frame-state.d.ts +3 -1
- package/dist/tileset-3d/helpers/frame-state.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/frame-state.js +1 -0
- package/dist/tileset-3d/helpers/frame-state.js.map +1 -1
- package/dist/tileset-3d/helpers/i3s-lod.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/i3s-lod.js +20 -8
- package/dist/tileset-3d/helpers/i3s-lod.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -9
- package/src/index.ts +42 -1
- package/src/point-cloud/point-cloud-tileset.ts +66 -12
- package/src/point-cloud/types.ts +17 -0
- package/src/raster-set.ts +46 -11
- package/src/spatial/format-spatial-reference.ts +311 -0
- package/src/spatial/get-spatial-coordinate-frame.ts +74 -0
- package/src/spatial/i3s-elevation.ts +96 -0
- package/src/spatial/i3s-spatial-transformer.ts +957 -0
- package/src/spatial/spatial-coordinate-transformer.ts +276 -0
- package/src/spatial/spatial-resource-registry.ts +79 -0
- package/src/spatial/spatial-types.ts +422 -0
- package/src/tileset-3d/common/tile-3d.ts +156 -69
- package/src/tileset-3d/common/tileset-3d.ts +77 -6
- package/src/tileset-3d/common/tileset-source.ts +15 -0
- package/src/tileset-3d/common/tileset-traverser.ts +11 -6
- package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +100 -22
- package/src/tileset-3d/format-3d-tiles/tiles-3d-source.ts +36 -56
- package/src/tileset-3d/format-i3s/i3s-source.ts +119 -18
- package/src/tileset-3d/helpers/bounding-volume.ts +3 -55
- package/src/tileset-3d/helpers/frame-state.ts +3 -0
- package/src/tileset-3d/helpers/i3s-lod.ts +22 -8
- package/src/types.ts +3 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { getI3SLinearUnitScale, getI3SVerticalUnitScale } from "./i3s-elevation.js";
|
|
5
|
+
import { createTilesetSpatialReference } from "./spatial-types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Discovers normalized spatial metadata from an I3S scene-layer document.
|
|
8
|
+
*
|
|
9
|
+
* I3S encodes geographic coordinates in longitude/latitude wire order even for authority
|
|
10
|
+
* definitions whose formal axis order differs.
|
|
11
|
+
*
|
|
12
|
+
* @param layer - Parsed I3S layer document.
|
|
13
|
+
* @returns Normalized source spatial metadata.
|
|
14
|
+
*/
|
|
15
|
+
export function getI3SSpatialReference(layer) {
|
|
16
|
+
const spatialReference = layer.spatialReference || layer.fullExtent?.spatialReference;
|
|
17
|
+
const sourceCrs = getI3SCrsDefinition(spatialReference);
|
|
18
|
+
const verticalCrs = layer.heightModelInfo?.vertCRS || getI3SVerticalCrsDefinition(spatialReference);
|
|
19
|
+
const heightModel = layer.heightModelInfo?.heightModel;
|
|
20
|
+
const verticalUnit = layer.heightModelInfo?.heightUnit;
|
|
21
|
+
const verticalUnitScale = getI3SVerticalUnitScale(verticalUnit, layer.ZFactor);
|
|
22
|
+
const heightReference = heightModel === 'ellipsoidal'
|
|
23
|
+
? 'ellipsoidal'
|
|
24
|
+
: heightModel === 'gravity_related_height'
|
|
25
|
+
? 'orthometric'
|
|
26
|
+
: 'unknown';
|
|
27
|
+
const sourceIdentifier = getCrsIdentifier(spatialReference);
|
|
28
|
+
const coordinateFrame = sourceIdentifier === undefined
|
|
29
|
+
? getWktCoordinateFrame(spatialReference?.wkt)
|
|
30
|
+
: getIdentifierCoordinateFrame(sourceIdentifier);
|
|
31
|
+
const units = getI3SCoordinateUnits(coordinateFrame, verticalUnit, layer.ZFactor);
|
|
32
|
+
const warnings = [];
|
|
33
|
+
const elevationMode = getI3SElevationMode(layer.elevationInfo?.mode);
|
|
34
|
+
const elevationUnit = layer.elevationInfo ? layer.elevationInfo.unit || 'meter' : undefined;
|
|
35
|
+
const elevationUnitScale = getI3SLinearUnitScale(elevationUnit);
|
|
36
|
+
if (verticalUnitScale === undefined) {
|
|
37
|
+
warnings.push(layer.ZFactor !== undefined
|
|
38
|
+
? `I3S ZFactor ${layer.ZFactor} is not a positive finite conversion factor`
|
|
39
|
+
: `Unsupported I3S vertical unit ${verticalUnit}`);
|
|
40
|
+
}
|
|
41
|
+
if (layer.elevationInfo && elevationUnitScale === undefined) {
|
|
42
|
+
warnings.push(`Unsupported I3S elevation unit ${elevationUnit}`);
|
|
43
|
+
}
|
|
44
|
+
if (layer.elevationInfo?.mode && !elevationMode) {
|
|
45
|
+
warnings.push(`Unsupported I3S elevation mode ${layer.elevationInfo.mode}`);
|
|
46
|
+
}
|
|
47
|
+
if (elevationMode && elevationMode !== 'absoluteHeight') {
|
|
48
|
+
warnings.push(`I3S elevation mode ${elevationMode} requires a terrain or scene elevation provider`);
|
|
49
|
+
}
|
|
50
|
+
return createTilesetSpatialReference({
|
|
51
|
+
sourceCrs,
|
|
52
|
+
sourceCrsRepresentation: sourceIdentifier !== undefined ? 'identifier' : sourceCrs ? 'wkt' : undefined,
|
|
53
|
+
sourceCrsAlternatives: sourceIdentifier !== undefined && spatialReference?.wkt
|
|
54
|
+
? [{ definition: spatialReference.wkt, representation: 'wkt' }]
|
|
55
|
+
: undefined,
|
|
56
|
+
verticalCrs,
|
|
57
|
+
units,
|
|
58
|
+
verticalUnitScale: verticalUnitScale ?? Number.NaN,
|
|
59
|
+
heightReference,
|
|
60
|
+
elevationMode,
|
|
61
|
+
elevationOffset: layer.elevationInfo?.offset,
|
|
62
|
+
elevationUnit,
|
|
63
|
+
elevationUnitScale: layer.elevationInfo?.mode && !elevationMode
|
|
64
|
+
? Number.NaN
|
|
65
|
+
: (elevationUnitScale ?? (layer.elevationInfo ? Number.NaN : 1)),
|
|
66
|
+
coordinateFrame,
|
|
67
|
+
axisOrder: sourceCrs ? 'xyz' : 'unknown',
|
|
68
|
+
provenance: sourceCrs ? 'metadata' : 'unknown',
|
|
69
|
+
warnings
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** Return per-component I3S units only when their coordinate association is unambiguous. */
|
|
73
|
+
function getI3SCoordinateUnits(coordinateFrame, verticalUnit, zFactor) {
|
|
74
|
+
if (coordinateFrame === 'geocentric') {
|
|
75
|
+
return ['meter', 'meter', 'meter'];
|
|
76
|
+
}
|
|
77
|
+
if (coordinateFrame === 'geographic' && (verticalUnit || zFactor === undefined)) {
|
|
78
|
+
return ['degree', 'degree', verticalUnit || 'meter'];
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
/** Return a supported I3S elevation mode without widening the public descriptor. */
|
|
83
|
+
function getI3SElevationMode(mode) {
|
|
84
|
+
switch (mode) {
|
|
85
|
+
case 'absoluteHeight':
|
|
86
|
+
case 'onTheGround':
|
|
87
|
+
case 'relativeToGround':
|
|
88
|
+
case 'relativeToScene':
|
|
89
|
+
return mode;
|
|
90
|
+
default:
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Discovers the 3D Tiles geocentric CRS and coordinate epoch from structured metadata semantics.
|
|
96
|
+
*
|
|
97
|
+
* The method intentionally does not infer ECEF from coordinate magnitude. A root `region`
|
|
98
|
+
* establishes the format's global ellipsoidal frame, while local tilesets without an explicit
|
|
99
|
+
* semantic remain unknown.
|
|
100
|
+
*
|
|
101
|
+
* @param tileset - Parsed 3D Tiles tileset document.
|
|
102
|
+
* @returns Normalized source spatial metadata.
|
|
103
|
+
*/
|
|
104
|
+
export function get3DTilesSpatialReference(tileset) {
|
|
105
|
+
const geocentricCrs = getTilesetSemanticValue(tileset, 'TILESET_CRS_GEOCENTRIC');
|
|
106
|
+
const coordinateEpoch = getTilesetSemanticValue(tileset, 'TILESET_CRS_COORDINATE_EPOCH');
|
|
107
|
+
const warnings = [];
|
|
108
|
+
let sourceCrs;
|
|
109
|
+
let provenance = 'unknown';
|
|
110
|
+
let sourceCrsState;
|
|
111
|
+
if (typeof geocentricCrs === 'string' && geocentricCrs.toUpperCase() !== 'UNKNOWN') {
|
|
112
|
+
sourceCrs = geocentricCrs;
|
|
113
|
+
provenance = 'metadata';
|
|
114
|
+
sourceCrsState = 'explicit';
|
|
115
|
+
}
|
|
116
|
+
else if (geocentricCrs !== undefined) {
|
|
117
|
+
warnings.push('3D Tiles geocentric CRS is explicitly unknown');
|
|
118
|
+
provenance = 'metadata';
|
|
119
|
+
sourceCrsState = 'unknown';
|
|
120
|
+
}
|
|
121
|
+
else if (tileset.root?.boundingVolume?.region) {
|
|
122
|
+
sourceCrs = 'EPSG:4978';
|
|
123
|
+
provenance = 'format-default';
|
|
124
|
+
sourceCrsState = 'default';
|
|
125
|
+
}
|
|
126
|
+
else if (tileset.schemaUri && !tileset.schema) {
|
|
127
|
+
warnings.push('External 3D Tiles metadata schema must be loaded before CRS semantics can resolve');
|
|
128
|
+
}
|
|
129
|
+
const epoch = parseCoordinateEpoch(coordinateEpoch);
|
|
130
|
+
if (coordinateEpoch !== undefined && epoch === undefined) {
|
|
131
|
+
warnings.push('3D Tiles coordinate epoch is not a finite decimal year');
|
|
132
|
+
}
|
|
133
|
+
return createTilesetSpatialReference({
|
|
134
|
+
sourceCrs,
|
|
135
|
+
sourceCrsState,
|
|
136
|
+
sourceCrsRepresentation: sourceCrs ? 'identifier' : undefined,
|
|
137
|
+
coordinateEpoch: epoch,
|
|
138
|
+
heightReference: sourceCrs ? 'ellipsoidal' : 'unknown',
|
|
139
|
+
coordinateFrame: sourceCrs ? 'geocentric' : 'unknown',
|
|
140
|
+
axisOrder: sourceCrs ? 'xyz' : 'unknown',
|
|
141
|
+
provenance,
|
|
142
|
+
warnings
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/** Parse the 3D Tiles decimal-year string while tolerating legacy numeric producer output. */
|
|
146
|
+
function parseCoordinateEpoch(value) {
|
|
147
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
if (typeof value === 'string' && !value.trim()) {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
const epoch = Number(value);
|
|
154
|
+
return Number.isFinite(epoch) ? epoch : undefined;
|
|
155
|
+
}
|
|
156
|
+
/** Return an I3S horizontal CRS definition, preferring current WKID aliases over legacy values. */
|
|
157
|
+
function getI3SCrsDefinition(spatialReference) {
|
|
158
|
+
const identifier = getCrsIdentifier(spatialReference);
|
|
159
|
+
if (identifier !== undefined) {
|
|
160
|
+
return `EPSG:${identifier}`;
|
|
161
|
+
}
|
|
162
|
+
return spatialReference?.wkt;
|
|
163
|
+
}
|
|
164
|
+
/** Return an I3S vertical CRS definition. */
|
|
165
|
+
function getI3SVerticalCrsDefinition(spatialReference) {
|
|
166
|
+
const identifier = spatialReference?.latestVcsWkid ?? spatialReference?.vcsWkid;
|
|
167
|
+
return identifier === undefined ? undefined : `EPSG:${identifier}`;
|
|
168
|
+
}
|
|
169
|
+
/** Return the preferred horizontal WKID. */
|
|
170
|
+
function getCrsIdentifier(spatialReference) {
|
|
171
|
+
return spatialReference?.latestWkid ?? spatialReference?.wkid;
|
|
172
|
+
}
|
|
173
|
+
/** Classify common EPSG identifiers used by I3S into their coordinate frames. */
|
|
174
|
+
function getIdentifierCoordinateFrame(identifier) {
|
|
175
|
+
if (identifier === 4978) {
|
|
176
|
+
return 'geocentric';
|
|
177
|
+
}
|
|
178
|
+
if (identifier === 4326 || identifier === 4490 || identifier === 4979) {
|
|
179
|
+
return 'geographic';
|
|
180
|
+
}
|
|
181
|
+
return 'projected';
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Classify a WKT root coordinate system without guessing when the declaration is ambiguous.
|
|
185
|
+
*
|
|
186
|
+
* WKT2 uses `GEODCRS` for both geographic and geocentric systems, so its `CS` declaration is
|
|
187
|
+
* inspected before assigning a frame.
|
|
188
|
+
*/
|
|
189
|
+
function getWktCoordinateFrame(wkt) {
|
|
190
|
+
if (!wkt) {
|
|
191
|
+
return 'unknown';
|
|
192
|
+
}
|
|
193
|
+
const normalizedWkt = wkt.trim().toUpperCase();
|
|
194
|
+
const rootKeyword = normalizedWkt.match(/^([A-Z][A-Z0-9_]*)\s*[\[(]/)?.[1];
|
|
195
|
+
if (rootKeyword === 'GEOCCS') {
|
|
196
|
+
return 'geocentric';
|
|
197
|
+
}
|
|
198
|
+
if (rootKeyword === 'GEOGCS' ||
|
|
199
|
+
rootKeyword === 'GEOGRAPHICCRS' ||
|
|
200
|
+
rootKeyword === 'GEOGRAPHIC2DCRS' ||
|
|
201
|
+
rootKeyword === 'GEOGRAPHIC3DCRS') {
|
|
202
|
+
return 'geographic';
|
|
203
|
+
}
|
|
204
|
+
if (rootKeyword === 'PROJCS' || rootKeyword === 'PROJCRS' || rootKeyword === 'PROJECTEDCRS') {
|
|
205
|
+
return 'projected';
|
|
206
|
+
}
|
|
207
|
+
if (rootKeyword === 'GEODCRS' || rootKeyword === 'GEODETICCRS') {
|
|
208
|
+
if (/\bCS\s*[\[(]\s*CARTESIAN\s*,\s*3\b/.test(normalizedWkt)) {
|
|
209
|
+
return 'geocentric';
|
|
210
|
+
}
|
|
211
|
+
if (/\bCS\s*[\[(]\s*ELLIPSOIDAL\s*,\s*[23]\b/.test(normalizedWkt)) {
|
|
212
|
+
return 'geographic';
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return 'unknown';
|
|
216
|
+
}
|
|
217
|
+
/** Resolve a tileset-wide structured metadata property by its standard semantic. */
|
|
218
|
+
function getTilesetSemanticValue(tileset, semantic) {
|
|
219
|
+
const classIdentifier = tileset.metadata?.class;
|
|
220
|
+
if (!classIdentifier) {
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
const classDefinition = tileset.schema?.classes?.[classIdentifier];
|
|
224
|
+
const propertyDefinitions = classDefinition?.properties;
|
|
225
|
+
const propertyValues = tileset.metadata?.properties;
|
|
226
|
+
for (const [propertyIdentifier, propertyDefinition] of Object.entries(propertyDefinitions || {})) {
|
|
227
|
+
if (propertyDefinition.semantic === semantic) {
|
|
228
|
+
return propertyValues?.[propertyIdentifier];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
//# sourceMappingURL=format-spatial-reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-spatial-reference.js","sourceRoot":"","sources":["../../src/spatial/format-spatial-reference.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,qBAAqB,EAAE,uBAAuB,EAAC,2BAAwB;AAC/E,OAAO,EAAC,6BAA6B,EAAC,2BAAwB;AAsC9D;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAmB;IACxD,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtF,MAAM,SAAS,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IACxD,MAAM,WAAW,GACf,KAAK,CAAC,eAAe,EAAE,OAAO,IAAI,2BAA2B,CAAC,gBAAgB,CAAC,CAAC;IAClF,MAAM,WAAW,GAAG,KAAK,CAAC,eAAe,EAAE,WAAW,CAAC;IACvD,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,EAAE,UAAU,CAA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IACxD,MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC;IACpD,KAAK,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,IAAI,MAAM,CAAC,OAAO,CACnE,mBAAmB,IAAI,EAAE,CAC1B,EAAE,CAAC;QACF,IAAI,kBAAkB,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC7C,OAAO,cAAc,EAAE,CAAC,kBAAkB,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReadonlyCRSDefinition, SpatialReferenceCoordinateFrame } from '@math.gl/crs';
|
|
2
|
+
/**
|
|
3
|
+
* Classify a CRS definition into the broad coordinate frame used by 3D format adapters.
|
|
4
|
+
*
|
|
5
|
+
* @param definition - CRS definition to classify.
|
|
6
|
+
* @returns The broad geographic, geocentric, projected, local, or unknown frame.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSpatialCoordinateFrame(definition: ReadonlyCRSDefinition): SpatialReferenceCoordinateFrame;
|
|
9
|
+
//# sourceMappingURL=get-spatial-coordinate-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-spatial-coordinate-frame.d.ts","sourceRoot":"","sources":["../../src/spatial/get-spatial-coordinate-frame.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,qBAAqB,EAAE,+BAA+B,EAAC,MAAM,cAAc,CAAC;AAczF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,qBAAqB,GAChC,+BAA+B,CA+CjC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const GEOGRAPHIC_CRS = 'EPSG:4326';
|
|
5
|
+
const GEOCENTRIC_CRS = 'EPSG:4978';
|
|
6
|
+
/** Normalize common OGC URL and URN CRS spellings to authority identifiers. */
|
|
7
|
+
function normalizeCrsIdentifier(identifier) {
|
|
8
|
+
const normalizedIdentifier = identifier.trim().toUpperCase();
|
|
9
|
+
const ogcMatch = normalizedIdentifier.match(/(?:\/DEF\/CRS\/|URN:OGC:DEF:CRS:)([A-Z0-9_-]+)(?:\/|::)(?:[^/:]*[/:])?([A-Z0-9_.-]+)$/);
|
|
10
|
+
return ogcMatch ? `${ogcMatch[1]}:${ogcMatch[2]}` : normalizedIdentifier;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Classify a CRS definition into the broad coordinate frame used by 3D format adapters.
|
|
14
|
+
*
|
|
15
|
+
* @param definition - CRS definition to classify.
|
|
16
|
+
* @returns The broad geographic, geocentric, projected, local, or unknown frame.
|
|
17
|
+
*/
|
|
18
|
+
export function getSpatialCoordinateFrame(definition) {
|
|
19
|
+
if (typeof definition === 'string') {
|
|
20
|
+
const normalized = normalizeCrsIdentifier(definition);
|
|
21
|
+
if (normalized === GEOCENTRIC_CRS || /^GEOCCS\s*[\[(]/.test(normalized)) {
|
|
22
|
+
return 'geocentric';
|
|
23
|
+
}
|
|
24
|
+
if (normalized === GEOGRAPHIC_CRS ||
|
|
25
|
+
normalized === 'EPSG:4490' ||
|
|
26
|
+
normalized === 'EPSG:4979' ||
|
|
27
|
+
normalized === 'OGC:CRS84' ||
|
|
28
|
+
normalized.includes('+PROJ=LONGLAT') ||
|
|
29
|
+
normalized.includes('+PROJ=LATLONG') ||
|
|
30
|
+
/^(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS|GEOGRAPHIC2DCRS|GEOGRAPHIC3DCRS)\s*[\[(]/.test(normalized)) {
|
|
31
|
+
return 'geographic';
|
|
32
|
+
}
|
|
33
|
+
if (/^(?:GEODCRS|GEODETICCRS)\s*[\[(]/.test(normalized)) {
|
|
34
|
+
return /CS\s*[\[(]\s*CARTESIAN/.test(normalized) ? 'geocentric' : 'geographic';
|
|
35
|
+
}
|
|
36
|
+
return 'projected';
|
|
37
|
+
}
|
|
38
|
+
const projJsonDefinition = definition;
|
|
39
|
+
if (projJsonDefinition.type === 'BoundCRS' && projJsonDefinition.source_crs) {
|
|
40
|
+
return getSpatialCoordinateFrame(projJsonDefinition.source_crs);
|
|
41
|
+
}
|
|
42
|
+
if (projJsonDefinition.type === 'CompoundCRS' && projJsonDefinition.components?.[0]) {
|
|
43
|
+
return getSpatialCoordinateFrame(projJsonDefinition.components[0]);
|
|
44
|
+
}
|
|
45
|
+
if (String(projJsonDefinition.type).includes('Projected')) {
|
|
46
|
+
return 'projected';
|
|
47
|
+
}
|
|
48
|
+
if (String(projJsonDefinition.type).includes('Geographic')) {
|
|
49
|
+
return 'geographic';
|
|
50
|
+
}
|
|
51
|
+
if (String(projJsonDefinition.type).includes('Geodetic')) {
|
|
52
|
+
return projJsonDefinition.coordinate_system?.subtype === 'Cartesian'
|
|
53
|
+
? 'geocentric'
|
|
54
|
+
: 'geographic';
|
|
55
|
+
}
|
|
56
|
+
return 'projected';
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=get-spatial-coordinate-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-spatial-coordinate-frame.js","sourceRoot":"","sources":["../../src/spatial/get-spatial-coordinate-frame.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAIpC,MAAM,cAAc,GAAG,WAAW,CAAC;AACnC,MAAM,cAAc,GAAG,WAAW,CAAC;AAEnC,+EAA+E;AAC/E,SAAS,sBAAsB,CAAC,UAAkB;IAChD,MAAM,oBAAoB,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7D,MAAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CACzC,uFAAuF,CACxF,CAAC;IACF,OAAO,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,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,CAAC;IACrE,CAAC;IACD,IAAI,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAC1D,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QAC3D,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,IAAI,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QACzD,OAAO,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,KAAK,WAAW;YAClE,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,YAAY,CAAC;IACnB,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves an ArcGIS/I3S linear unit to meters.
|
|
3
|
+
*
|
|
4
|
+
* @param unit - I3S `heightUnit`, `elevationInfo.unit`, or provider unit.
|
|
5
|
+
* @returns Meters per unit, or `undefined` when the declaration is unsupported.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getI3SLinearUnitScale(unit: string | undefined): number | undefined;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the source-Z conversion declared by an I3S layer.
|
|
10
|
+
*
|
|
11
|
+
* Legacy `ZFactor` is an explicit conversion to meters and takes precedence over the descriptive
|
|
12
|
+
* `heightUnit`. This avoids applying the same feet-to-meters conversion twice on layers that
|
|
13
|
+
* publish both fields.
|
|
14
|
+
*
|
|
15
|
+
* @param heightUnit - Unit declared by `heightModelInfo.heightUnit`.
|
|
16
|
+
* @param zFactor - Legacy layer conversion factor.
|
|
17
|
+
* @returns Meters per stored Z unit, or `undefined` for an invalid declaration.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getI3SVerticalUnitScale(heightUnit: string | undefined, zFactor: number | undefined): number | undefined;
|
|
20
|
+
//# sourceMappingURL=i3s-elevation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i3s-elevation.d.ts","sourceRoot":"","sources":["../../src/spatial/i3s-elevation.ts"],"names":[],"mappings":"AA6DA;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,MAAM,GAAG,SAAS,CAKpB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
const LINEAR_UNIT_TO_METERS = Object.freeze({
|
|
5
|
+
meter: 1,
|
|
6
|
+
millimeter: 0.001,
|
|
7
|
+
centimeter: 0.01,
|
|
8
|
+
decimeter: 0.1,
|
|
9
|
+
kilometer: 1000,
|
|
10
|
+
foot: 0.3048,
|
|
11
|
+
yard: 0.9144,
|
|
12
|
+
mile: 1609.344,
|
|
13
|
+
'us-foot': 1200 / 3937,
|
|
14
|
+
'us-inch': 0.0254000508001016,
|
|
15
|
+
'us-yard': 3600 / 3937,
|
|
16
|
+
'us-mile': 6336000 / 3937,
|
|
17
|
+
'clarke-foot': 0.3047972654,
|
|
18
|
+
'clarke-yard': 0.9143917962,
|
|
19
|
+
'clarke-link': 0.201166195164,
|
|
20
|
+
'sears-yard': 0.914398414616,
|
|
21
|
+
'sears-foot': 0.304799471539,
|
|
22
|
+
'sears-chain': 20.1167651216,
|
|
23
|
+
'sears-1922-truncated-chain': 20.116756,
|
|
24
|
+
'benoit-1895-b-chain': 20.1167824944,
|
|
25
|
+
'indian-yard': 0.914398530744,
|
|
26
|
+
'indian-1937-yard': 0.91439523,
|
|
27
|
+
'gold-coast-foot': 0.304799710181
|
|
28
|
+
});
|
|
29
|
+
const LINEAR_UNIT_ALIASES = Object.freeze({
|
|
30
|
+
m: 'meter',
|
|
31
|
+
metre: 'meter',
|
|
32
|
+
meters: 'meter',
|
|
33
|
+
metres: 'meter',
|
|
34
|
+
mm: 'millimeter',
|
|
35
|
+
millimetre: 'millimeter',
|
|
36
|
+
millimeters: 'millimeter',
|
|
37
|
+
millimetres: 'millimeter',
|
|
38
|
+
cm: 'centimeter',
|
|
39
|
+
centimetre: 'centimeter',
|
|
40
|
+
centimeters: 'centimeter',
|
|
41
|
+
centimetres: 'centimeter',
|
|
42
|
+
dm: 'decimeter',
|
|
43
|
+
decimetre: 'decimeter',
|
|
44
|
+
decimeters: 'decimeter',
|
|
45
|
+
decimetres: 'decimeter',
|
|
46
|
+
km: 'kilometer',
|
|
47
|
+
kilometre: 'kilometer',
|
|
48
|
+
kilometers: 'kilometer',
|
|
49
|
+
kilometres: 'kilometer',
|
|
50
|
+
ft: 'foot',
|
|
51
|
+
feet: 'foot',
|
|
52
|
+
'us-survey-foot': 'us-foot',
|
|
53
|
+
'us-survey-feet': 'us-foot',
|
|
54
|
+
yd: 'yard',
|
|
55
|
+
yards: 'yard',
|
|
56
|
+
mi: 'mile',
|
|
57
|
+
miles: 'mile'
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Resolves an ArcGIS/I3S linear unit to meters.
|
|
61
|
+
*
|
|
62
|
+
* @param unit - I3S `heightUnit`, `elevationInfo.unit`, or provider unit.
|
|
63
|
+
* @returns Meters per unit, or `undefined` when the declaration is unsupported.
|
|
64
|
+
*/
|
|
65
|
+
export function getI3SLinearUnitScale(unit) {
|
|
66
|
+
if (!unit) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
const normalized = unit.trim().toLowerCase().replaceAll('_', '-');
|
|
70
|
+
const canonical = LINEAR_UNIT_ALIASES[normalized] || normalized;
|
|
71
|
+
return LINEAR_UNIT_TO_METERS[canonical];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolves the source-Z conversion declared by an I3S layer.
|
|
75
|
+
*
|
|
76
|
+
* Legacy `ZFactor` is an explicit conversion to meters and takes precedence over the descriptive
|
|
77
|
+
* `heightUnit`. This avoids applying the same feet-to-meters conversion twice on layers that
|
|
78
|
+
* publish both fields.
|
|
79
|
+
*
|
|
80
|
+
* @param heightUnit - Unit declared by `heightModelInfo.heightUnit`.
|
|
81
|
+
* @param zFactor - Legacy layer conversion factor.
|
|
82
|
+
* @returns Meters per stored Z unit, or `undefined` for an invalid declaration.
|
|
83
|
+
*/
|
|
84
|
+
export function getI3SVerticalUnitScale(heightUnit, zFactor) {
|
|
85
|
+
if (zFactor !== undefined) {
|
|
86
|
+
return Number.isFinite(zFactor) && zFactor > 0 ? zFactor : undefined;
|
|
87
|
+
}
|
|
88
|
+
return heightUnit ? getI3SLinearUnitScale(heightUnit) : 1;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=i3s-elevation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i3s-elevation.js","sourceRoot":"","sources":["../../src/spatial/i3s-elevation.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,qBAAqB,GAAqC,MAAM,CAAC,MAAM,CAAC;IAC5E,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,IAAI,GAAG,IAAI;IACtB,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,IAAI,GAAG,IAAI;IACtB,SAAS,EAAE,OAAO,GAAG,IAAI;IACzB,aAAa,EAAE,YAAY;IAC3B,aAAa,EAAE,YA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AC;IAClE,MAAM,SAAS,GAAG,mBAAmB,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC;IAChE,OAAO,qBAAqB,CAAC,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAA8B,EAC9B,OAA2B;IAE3B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,CAAC;IACD,OAAO,UAAU,CAAC,CAAC,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { Matrix4 } from '@math.gl/core';
|
|
2
|
+
import type { TilesetCoordinateFrame, TilesetSpatialOptions, TilesetSpatialReference } from "./spatial-types.js";
|
|
3
|
+
/** Minimal I3S oriented bounding box required by the spatial adapter. */
|
|
4
|
+
export type I3SSpatialObb = {
|
|
5
|
+
/** Center in source CRS coordinates. */
|
|
6
|
+
center: ArrayLike<number>;
|
|
7
|
+
/** Half lengths along the oriented axes. */
|
|
8
|
+
halfSize: ArrayLike<number>;
|
|
9
|
+
/** Orientation quaternion. */
|
|
10
|
+
quaternion: ArrayLike<number>;
|
|
11
|
+
};
|
|
12
|
+
/** Input used to rebuild an I3S node bound in the selected output frame. */
|
|
13
|
+
export type I3SSpatialBounds = {
|
|
14
|
+
/** Minimum bounding sphere encoded as source center plus radius. */
|
|
15
|
+
mbs?: ArrayLike<number>;
|
|
16
|
+
/** Oriented source bound, preferred when available. */
|
|
17
|
+
obb?: I3SSpatialObb;
|
|
18
|
+
/** Frame in which I3S vectors and quaternions are expressed. */
|
|
19
|
+
normalReferenceFrame?: string;
|
|
20
|
+
};
|
|
21
|
+
/** Renderer-ready positions and metadata produced for an I3S geometry resource. */
|
|
22
|
+
export type I3STransformedPositions = {
|
|
23
|
+
/** Float32 offsets from the stable target origin. */
|
|
24
|
+
positions: Float32Array;
|
|
25
|
+
/** Reconstructed absolute source positions retained for normal transformation. */
|
|
26
|
+
sourcePositions: Float64Array;
|
|
27
|
+
/** Stable origin in target CRS coordinates. */
|
|
28
|
+
origin: [number, number, number];
|
|
29
|
+
/** Origin used by geographic deck.gl coordinate systems. */
|
|
30
|
+
cartographicOrigin: [number, number, number];
|
|
31
|
+
/** Renderer coordinate-system discriminator. */
|
|
32
|
+
coordinateSystem: 'cartesian' | 'lnglat-offsets';
|
|
33
|
+
/** Translation matrix used for Cartesian target offsets. */
|
|
34
|
+
modelMatrix: Matrix4;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Applies one normalized I3S horizontal CRS operation consistently to geometry, normals, origins,
|
|
38
|
+
* and node bounds.
|
|
39
|
+
*/
|
|
40
|
+
export declare class I3SSpatialTransformer {
|
|
41
|
+
/** Descriptor attached to output after all adapter-owned spatial values have been transformed. */
|
|
42
|
+
readonly spatialReference: TilesetSpatialReference;
|
|
43
|
+
/** Broad coordinate frame of the selected output CRS. */
|
|
44
|
+
readonly targetCoordinateFrame: TilesetCoordinateFrame;
|
|
45
|
+
/** Source-to-target position operation. */
|
|
46
|
+
private readonly positionTransformer;
|
|
47
|
+
/** Source-to-WGS84 geographic operation used for vector-frame conversion. */
|
|
48
|
+
private readonly sourceToGeographicTransformer;
|
|
49
|
+
/** WGS84-geographic-to-target operation used for normal finite differences. */
|
|
50
|
+
private readonly geographicToTargetTransformer;
|
|
51
|
+
/** Source frame recorded by I3S metadata. */
|
|
52
|
+
private readonly sourceCoordinateFrame;
|
|
53
|
+
/** Source Z multiplier that normalizes stored elevation values to meters. */
|
|
54
|
+
private readonly sourceVerticalUnitScale;
|
|
55
|
+
/** I3S elevation placement mode. */
|
|
56
|
+
private readonly elevationMode?;
|
|
57
|
+
/** I3S elevation offset normalized to meters. */
|
|
58
|
+
private readonly elevationOffset;
|
|
59
|
+
/** Terrain or scene provider selected for the declared placement mode. */
|
|
60
|
+
private readonly elevationProvider?;
|
|
61
|
+
/** Provider height multiplier that normalizes returned values to meters. */
|
|
62
|
+
private readonly providerUnitScale;
|
|
63
|
+
/** Optional provider-height to layer-height datum operation. */
|
|
64
|
+
private readonly providerHeightTransformer?;
|
|
65
|
+
/**
|
|
66
|
+
* Creates an I3S spatial adapter.
|
|
67
|
+
*
|
|
68
|
+
* @param spatialReference - Transformable I3S spatial descriptor.
|
|
69
|
+
* @param options - Registered geoid and custom resource options used by the shared transformer.
|
|
70
|
+
*/
|
|
71
|
+
constructor(spatialReference: TilesetSpatialReference, options?: TilesetSpatialOptions);
|
|
72
|
+
/** Transform one absolute I3S source position. */
|
|
73
|
+
transformPosition(position: ArrayLike<number>): [number, number, number];
|
|
74
|
+
/** Transform one absolute I3S source position after asynchronous surface placement. */
|
|
75
|
+
transformPositionAsync(position: ArrayLike<number>): Promise<[number, number, number]>;
|
|
76
|
+
/** Transform an already placed, meter-normalized position to the requested target. */
|
|
77
|
+
private transformPlacedPosition;
|
|
78
|
+
/** Transform one absolute I3S source position to WGS84 longitude, latitude, and height. */
|
|
79
|
+
transformSourcePositionToGeographic(position: ArrayLike<number>): [number, number, number];
|
|
80
|
+
/** Transform one source position to WGS84 after asynchronous elevation placement. */
|
|
81
|
+
transformSourcePositionToGeographicAsync(position: ArrayLike<number>): Promise<[number, number, number]>;
|
|
82
|
+
/**
|
|
83
|
+
* Transform absolute Float64 positions and return stable Float32 offsets around a target origin.
|
|
84
|
+
*
|
|
85
|
+
* @param sourcePositions - Absolute positions in source CRS order.
|
|
86
|
+
* @param sourceOrigin - Stable source origin, normally the node MBS or OBB center.
|
|
87
|
+
*/
|
|
88
|
+
transformPositions(sourcePositions: ArrayLike<number>, sourceOrigin: ArrayLike<number>): I3STransformedPositions;
|
|
89
|
+
/**
|
|
90
|
+
* Transform positions after asynchronously sampling any requested terrain or scene surface.
|
|
91
|
+
*
|
|
92
|
+
* @param sourcePositions - Absolute positions in source CRS order.
|
|
93
|
+
* @param sourceOrigin - Stable source origin, normally the node MBS or OBB center.
|
|
94
|
+
* @returns Renderer-ready target-frame offsets and stable origin metadata.
|
|
95
|
+
*/
|
|
96
|
+
transformPositionsAsync(sourcePositions: ArrayLike<number>, sourceOrigin: ArrayLike<number>): Promise<I3STransformedPositions>;
|
|
97
|
+
/** Transform already placed positions into renderer-relative target coordinates. */
|
|
98
|
+
private transformPlacedPositions;
|
|
99
|
+
/**
|
|
100
|
+
* Transform I3S normals into the selected target basis.
|
|
101
|
+
*
|
|
102
|
+
* Earth-centered normals are rotated directly. Vertex-reference-frame normals are first mapped
|
|
103
|
+
* through the local east/north/up basis at each source position.
|
|
104
|
+
*
|
|
105
|
+
* @param normals - Three-component normal vectors.
|
|
106
|
+
* @param sourcePositions - Absolute source position paired with each normal.
|
|
107
|
+
* @param normalReferenceFrame - I3S normal frame declaration.
|
|
108
|
+
*/
|
|
109
|
+
transformNormals(normals: ArrayLike<number>, sourcePositions: ArrayLike<number>, normalReferenceFrame?: string): Float32Array;
|
|
110
|
+
/**
|
|
111
|
+
* Rebuild an I3S node bound from transformed corner or sphere-axis samples.
|
|
112
|
+
*
|
|
113
|
+
* @param bounds - Source MBS/OBB fields.
|
|
114
|
+
* @returns A generic tile `region` for geographic output or axis-aligned `box` otherwise.
|
|
115
|
+
*/
|
|
116
|
+
transformBoundingVolume(bounds: I3SSpatialBounds): {
|
|
117
|
+
box?: number[];
|
|
118
|
+
region?: number[];
|
|
119
|
+
};
|
|
120
|
+
/** Rebuild an I3S bound in the target frame after asynchronous elevation placement. */
|
|
121
|
+
transformBoundingVolumeAsync(bounds: I3SSpatialBounds): Promise<{
|
|
122
|
+
box?: number[];
|
|
123
|
+
region?: number[];
|
|
124
|
+
}>;
|
|
125
|
+
/** Rebuild an I3S bound as a WGS84 geographic region for geographic traversal algorithms. */
|
|
126
|
+
transformBoundingVolumeToGeographic(bounds: I3SSpatialBounds): {
|
|
127
|
+
region: number[];
|
|
128
|
+
};
|
|
129
|
+
/** Rebuild an I3S bound as WGS84 geographic after asynchronous elevation placement. */
|
|
130
|
+
transformBoundingVolumeToGeographicAsync(bounds: I3SSpatialBounds): Promise<{
|
|
131
|
+
region: number[];
|
|
132
|
+
}>;
|
|
133
|
+
/** Rebuild an I3S bound as a WGS84 ECEF box for generic `Tileset3D` traversal. */
|
|
134
|
+
transformBoundingVolumeToGeocentric(bounds: I3SSpatialBounds): {
|
|
135
|
+
box: number[];
|
|
136
|
+
};
|
|
137
|
+
/** Rebuild an I3S bound as WGS84 ECEF after asynchronous elevation placement. */
|
|
138
|
+
transformBoundingVolumeToGeocentricAsync(bounds: I3SSpatialBounds): Promise<{
|
|
139
|
+
box: number[];
|
|
140
|
+
}>;
|
|
141
|
+
/** Return a WGS84 geographic MBS used by the I3S screen-threshold calculation. */
|
|
142
|
+
transformBoundingSphereToGeographic(bounds: I3SSpatialBounds): [number, number, number, number];
|
|
143
|
+
/** Return a placed WGS84 MBS used by the I3S screen-threshold calculation. */
|
|
144
|
+
transformBoundingSphereToGeographicAsync(bounds: I3SSpatialBounds): Promise<[number, number, number, number]>;
|
|
145
|
+
/**
|
|
146
|
+
* Rebuild traversal, target-output, and I3S LOD bounds from one elevation-sampling batch.
|
|
147
|
+
*
|
|
148
|
+
* @param bounds - Source MBS/OBB fields.
|
|
149
|
+
* @returns Parallel bounds in WGS84 ECEF, the selected output frame, and WGS84 geographic.
|
|
150
|
+
*/
|
|
151
|
+
transformBoundsAsync(bounds: I3SSpatialBounds): Promise<{
|
|
152
|
+
boundingVolume: {
|
|
153
|
+
box: number[];
|
|
154
|
+
};
|
|
155
|
+
spatialBoundingVolume: {
|
|
156
|
+
box?: number[];
|
|
157
|
+
region?: number[];
|
|
158
|
+
};
|
|
159
|
+
i3sLodMbs: [number, number, number, number];
|
|
160
|
+
}>;
|
|
161
|
+
/**
|
|
162
|
+
* Rebuild Point Cloud traversal and target-output bounds from one elevation-sampling batch.
|
|
163
|
+
*
|
|
164
|
+
* @param bounds - Source OBB fields.
|
|
165
|
+
* @returns WGS84 geographic traversal bound plus the selected output-frame bound.
|
|
166
|
+
*/
|
|
167
|
+
transformPointCloudBoundsAsync(bounds: I3SSpatialBounds): Promise<{
|
|
168
|
+
boundingVolume: {
|
|
169
|
+
region: number[];
|
|
170
|
+
};
|
|
171
|
+
spatialBoundingVolume: {
|
|
172
|
+
box?: number[];
|
|
173
|
+
region?: number[];
|
|
174
|
+
};
|
|
175
|
+
}>;
|
|
176
|
+
/** Sample a source I3S bound and normalize every sample to WGS84 geographic coordinates. */
|
|
177
|
+
private getGeographicBoundSamples;
|
|
178
|
+
/** Sample, place, and normalize one source bound to WGS84 geographic coordinates. */
|
|
179
|
+
private getGeographicBoundSamplesAsync;
|
|
180
|
+
/** Apply a provider's conservative surface range to an entire geographic bound footprint. */
|
|
181
|
+
private placeGeographicBoundSamples;
|
|
182
|
+
/** Apply source units and non-surface placement without awaiting external resources. */
|
|
183
|
+
private placeSourcePositionsSync;
|
|
184
|
+
/** Apply source units and all I3S elevation-placement modes. */
|
|
185
|
+
private placeSourcePositions;
|
|
186
|
+
/** Transform one earth-centered normal to the selected target basis. */
|
|
187
|
+
private transformEcefNormal;
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=i3s-spatial-transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i3s-spatial-transformer.d.ts","sourceRoot":"","sources":["../../src/spatial/i3s-spatial-transformer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,OAAO,EAAsB,MAAM,eAAe,CAAC;AAWpE,OAAO,KAAK,EACV,sBAAsB,EAItB,qBAAqB,EACrB,uBAAuB,EACxB,2BAAwB;AAEzB,yEAAyE;AACzE,MAAM,MAAM,aAAa,GAAG;IAC1B,wCAAwC;IACxC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1B,4CAA4C;IAC5C,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