@loaders.gl/tiles 5.0.0-alpha.10 → 5.0.0-alpha.12
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/dist.dev.js +37183 -19131
- package/dist/dist.min.js +22 -3
- package/dist/index.cjs +620 -2027
- package/dist/index.cjs.map +4 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/point-cloud-tile-source-loader-types.d.ts +31 -0
- package/dist/point-cloud-tile-source-loader-types.d.ts.map +1 -0
- package/dist/point-cloud-tile-source-loader-types.js +34 -0
- package/dist/point-cloud-tile-source-loader-types.js.map +1 -0
- package/dist/point-cloud-tile-source-loader.cjs +81 -0
- package/dist/point-cloud-tile-source-loader.cjs.map +7 -0
- package/dist/point-cloud-tile-source-loader.d.ts +27 -0
- package/dist/point-cloud-tile-source-loader.d.ts.map +1 -0
- package/dist/point-cloud-tile-source-loader.js +17 -0
- package/dist/point-cloud-tile-source-loader.js.map +1 -0
- package/dist/point-cloud-tile-source-types.d.ts +15 -0
- package/dist/point-cloud-tile-source-types.d.ts.map +1 -0
- package/dist/point-cloud-tile-source-types.js +5 -0
- package/dist/point-cloud-tile-source-types.js.map +1 -0
- package/dist/point-cloud-tile-source.cjs +105 -0
- package/dist/point-cloud-tile-source.cjs.map +7 -0
- package/dist/point-cloud-tile-source.d.ts +36 -0
- package/dist/point-cloud-tile-source.d.ts.map +1 -0
- package/dist/point-cloud-tile-source.js +84 -0
- package/dist/point-cloud-tile-source.js.map +1 -0
- package/dist/spatial/i3s-spatial-transformer.d.ts +16 -0
- package/dist/spatial/i3s-spatial-transformer.d.ts.map +1 -1
- package/dist/spatial/i3s-spatial-transformer.js +45 -0
- package/dist/spatial/i3s-spatial-transformer.js.map +1 -1
- package/dist/spatial/spatial-coordinate-transformer.d.ts +3 -1
- package/dist/spatial/spatial-coordinate-transformer.d.ts.map +1 -1
- package/dist/spatial/spatial-coordinate-transformer.js +25 -9
- package/dist/spatial/spatial-coordinate-transformer.js.map +1 -1
- package/dist/spatial/spatial-resource-registry.d.ts +3 -0
- package/dist/spatial/spatial-resource-registry.d.ts.map +1 -1
- package/dist/spatial/spatial-resource-registry.js +12 -3
- package/dist/spatial/spatial-resource-registry.js.map +1 -1
- package/dist/spatial/tiles-3d-spatial-transformer.d.ts.map +1 -1
- package/dist/spatial/tiles-3d-spatial-transformer.js +0 -12
- package/dist/spatial/tiles-3d-spatial-transformer.js.map +1 -1
- package/dist/tileset-2d.d.ts +2 -1
- package/dist/tileset-2d.d.ts.map +1 -1
- package/dist/tileset-2d.js +1 -1
- package/dist/tileset-2d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.d.ts +10 -1
- package/dist/tileset-3d/common/tileset-3d.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-3d.js +42 -9
- package/dist/tileset-3d/common/tileset-3d.js.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/common/tileset-traverser.js +2 -3
- package/dist/tileset-3d/common/tileset-traverser.js.map +1 -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 +0 -3
- package/dist/tileset-3d/format-3d-tiles/implicit-tiling.js.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts +1 -0
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.d.ts.map +1 -1
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js +12 -4
- package/dist/tileset-3d/format-3d-tiles/tileset-3d-traverser.js.map +1 -1
- package/dist/tileset-3d/helpers/s2-bounding-volume.d.ts.map +1 -1
- package/dist/tileset-3d/helpers/s2-bounding-volume.js +0 -3
- package/dist/tileset-3d/helpers/s2-bounding-volume.js.map +1 -1
- package/package.json +25 -13
- package/src/index.ts +8 -1
- package/src/point-cloud-tile-source-loader-types.ts +53 -0
- package/src/point-cloud-tile-source-loader.ts +32 -0
- package/src/point-cloud-tile-source-types.ts +20 -0
- package/src/point-cloud-tile-source.ts +112 -0
- package/src/spatial/i3s-spatial-transformer.ts +64 -0
- package/src/spatial/spatial-coordinate-transformer.ts +30 -9
- package/src/spatial/spatial-resource-registry.ts +14 -3
- package/src/spatial/tiles-3d-spatial-transformer.ts +0 -12
- package/src/tileset-2d.ts +25 -1
- package/src/tileset-3d/common/tileset-3d.ts +56 -12
- package/src/tileset-3d/common/tileset-traverser.ts +2 -4
- package/src/tileset-3d/format-3d-tiles/implicit-tiling.ts +0 -3
- package/src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts +16 -4
- package/src/tileset-3d/helpers/s2-bounding-volume.ts +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tileset-3d-traverser.js","sourceRoot":"","sources":["../../../src/tileset-3d/format-3d-tiles/tileset-3d-traverser.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,wEAAwE;AACxE,4FAA4F;AAE5F,OAAO,EAAC,wBAAwB,EAAE,eAAe,EAAC,2BAAwB;AAC1E,OAAO,EAAC,gBAAgB,EAAC,uCAAoC;AAI7D,MAAM,OAAO,kBAAmB,SAAQ,gBAAgB;IACtD,6EAA6E;IAC5D,uBAAuB,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE1E;;;;;OAKG;IACO,iBAAiB,CAAC,UAAsB;QAChD,MAAM,cAAc,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;QACpD,KAAK,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACrE,IAAI,UAAU,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,WAAW,KAAK,UAAU,CAAC,WAAW,EAAE,CAAC;gBACpF,OAAO,KAAK,CAAC;YACf,CAA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AAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s2-bounding-volume.d.ts","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/s2-bounding-volume.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"s2-bounding-volume.d.ts","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/s2-bounding-volume.ts"],"names":[],"mappings":"AAOA,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG;IACzB,uBAAuB;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,EAAE,CAQjF"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright vis.gl contributors
|
|
4
|
-
// TypeScript's legacy `node` resolution does not inspect package `exports`, but this public
|
|
5
|
-
// subpath is resolved by the package at runtime and avoids loading unrelated DGGS decoders.
|
|
6
|
-
// @ts-expect-error Conditional package subpath exports require a modern module resolver.
|
|
7
4
|
import { getS2Bounds } from '@math.gl/dggs/s2';
|
|
8
5
|
import { Ellipsoid, makeOBBFromRegion } from '@math.gl/geospatial';
|
|
9
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"s2-bounding-volume.js","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/s2-bounding-volume.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,gCAAgC;AAEhC,
|
|
1
|
+
{"version":3,"file":"s2-bounding-volume.js","sourceRoot":"","sources":["../../../src/tileset-3d/helpers/s2-bounding-volume.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,gCAAgC;AAEhC,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAC,SAAS,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAYjE;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B,CAAC,YAA0B;IACrE,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,mBAAmB,GAAG,iBAAiB,CAC3C,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC,aAAa,EAAE,YAAY,CAAC,aAAa,CAAC,EAClF,SAAS,CAAC,KAAK,EACf,EAAC,KAAK,EAAE,SAAS,EAAC,CACnB,CAAC;IACF,OAAO,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAC1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tiles",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.12",
|
|
4
4
|
"description": "Common components for different tiles loaders.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"import": "./dist/index.js",
|
|
30
30
|
"require": "./dist/index.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./point-cloud-tile-source-loader": {
|
|
33
|
+
"types": "./dist/point-cloud-tile-source-loader.d.ts",
|
|
34
|
+
"import": "./dist/point-cloud-tile-source-loader.js",
|
|
35
|
+
"require": "./dist/point-cloud-tile-source-loader.cjs"
|
|
36
|
+
},
|
|
37
|
+
"./point-cloud-tile-source": {
|
|
38
|
+
"types": "./dist/point-cloud-tile-source.d.ts",
|
|
39
|
+
"import": "./dist/point-cloud-tile-source.js",
|
|
40
|
+
"require": "./dist/point-cloud-tile-source.cjs"
|
|
31
41
|
}
|
|
32
42
|
},
|
|
33
43
|
"sideEffects": false,
|
|
@@ -37,20 +47,22 @@
|
|
|
37
47
|
"README.md"
|
|
38
48
|
],
|
|
39
49
|
"scripts": {
|
|
40
|
-
"pre-build": "npm run build-bundle && npm run build-bundle-dev",
|
|
50
|
+
"pre-build": "npm run build-cjs-entrypoints && npm run build-bundle && npm run build-bundle-dev",
|
|
41
51
|
"build-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
|
|
42
|
-
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
52
|
+
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js",
|
|
53
|
+
"build-cjs-entrypoints": "esbuild dist/index.js dist/point-cloud-tile-source.js dist/point-cloud-tile-source-loader.js --outdir=dist --out-extension:.js=.cjs --bundle --format=cjs --platform=node --target=node22 --sourcemap --external:@loaders.gl/* --external:@math.gl/*"
|
|
43
54
|
},
|
|
44
55
|
"dependencies": {
|
|
45
|
-
"@loaders.gl/loader-utils": "5.0.0-alpha.
|
|
46
|
-
"@loaders.gl/schema": "5.0.0-alpha.
|
|
47
|
-
"@
|
|
48
|
-
"@math.gl/
|
|
49
|
-
"@math.gl/
|
|
50
|
-
"@math.gl/
|
|
51
|
-
"@math.gl/
|
|
52
|
-
"@math.gl/
|
|
53
|
-
"@math.gl/
|
|
56
|
+
"@loaders.gl/loader-utils": "5.0.0-alpha.12",
|
|
57
|
+
"@loaders.gl/schema": "5.0.0-alpha.12",
|
|
58
|
+
"@loaders.gl/schema-utils": "5.0.0-alpha.12",
|
|
59
|
+
"@math.gl/core": "5.0.0-alpha.16",
|
|
60
|
+
"@math.gl/crs": "5.0.0-alpha.16",
|
|
61
|
+
"@math.gl/culling": "5.0.0-alpha.16",
|
|
62
|
+
"@math.gl/dggs": "5.0.0-alpha.16",
|
|
63
|
+
"@math.gl/geoid": "5.0.0-alpha.16",
|
|
64
|
+
"@math.gl/geospatial": "5.0.0-alpha.16",
|
|
65
|
+
"@math.gl/projection": "5.0.0-alpha.16",
|
|
54
66
|
"@probe.gl/stats": "^4.1.1"
|
|
55
67
|
},
|
|
56
68
|
"devDependencies": {
|
|
@@ -59,5 +71,5 @@
|
|
|
59
71
|
"peerDependencies": {
|
|
60
72
|
"@loaders.gl/core": "~5.0.0-alpha.0"
|
|
61
73
|
},
|
|
62
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "8cbff6cb3e55c4eb1305072743992af27ff0c171"
|
|
63
75
|
}
|
package/src/index.ts
CHANGED
|
@@ -148,7 +148,8 @@ export type {Tiles3DSpatialBoundingVolume} from './spatial/tiles-3d-spatial-tran
|
|
|
148
148
|
export type {
|
|
149
149
|
I3SSpatialBounds,
|
|
150
150
|
I3SSpatialObb,
|
|
151
|
-
I3STransformedPositions
|
|
151
|
+
I3STransformedPositions,
|
|
152
|
+
I3STransformedGeometry
|
|
152
153
|
} from './spatial/i3s-spatial-transformer';
|
|
153
154
|
export {I3SSpatialTransformer} from './spatial/i3s-spatial-transformer';
|
|
154
155
|
export {
|
|
@@ -170,3 +171,9 @@ export {
|
|
|
170
171
|
TILESET_TYPE,
|
|
171
172
|
LOD_METRIC_TYPE
|
|
172
173
|
} from './constants';
|
|
174
|
+
|
|
175
|
+
export {PointCloudTileSourceLoader} from './point-cloud-tile-source-loader-types';
|
|
176
|
+
export type {
|
|
177
|
+
PointCloudTileSourceInput,
|
|
178
|
+
PointCloudTileSourceOptions
|
|
179
|
+
} from './point-cloud-tile-source-types';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {CoreAPI, SourceLoader} from '@loaders.gl/loader-utils';
|
|
6
|
+
import type {PointCloudTileSource} from './point-cloud-tile-source';
|
|
7
|
+
import type {
|
|
8
|
+
PointCloudTileSourceInput,
|
|
9
|
+
PointCloudTileSourceOptions
|
|
10
|
+
} from './point-cloud-tile-source-types';
|
|
11
|
+
|
|
12
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
13
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
14
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
15
|
+
|
|
16
|
+
/** Loads the optional authoring runtime through an explicit package subpath. */
|
|
17
|
+
async function preloadPointCloudTileSource(): Promise<
|
|
18
|
+
typeof import('./point-cloud-tile-source-loader').PointCloudTileSourceLoaderWithParser
|
|
19
|
+
> {
|
|
20
|
+
const {PointCloudTileSourceLoaderWithParser} = await import(
|
|
21
|
+
'@loaders.gl/tiles/point-cloud-tile-source-loader'
|
|
22
|
+
);
|
|
23
|
+
return PointCloudTileSourceLoaderWithParser;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Metadata-only loader for creating an additive point source from decoded Mesh/Arrow input. */
|
|
27
|
+
export const PointCloudTileSourceLoader = {
|
|
28
|
+
dataType: null as unknown as PointCloudTileSource,
|
|
29
|
+
batchType: null as never,
|
|
30
|
+
name: 'PointCloudTiler',
|
|
31
|
+
id: 'point-cloud-tiler',
|
|
32
|
+
module: 'tiles',
|
|
33
|
+
version: VERSION,
|
|
34
|
+
extensions: [],
|
|
35
|
+
mimeTypes: [],
|
|
36
|
+
type: 'point-cloud',
|
|
37
|
+
fromUrl: false,
|
|
38
|
+
fromBlob: false,
|
|
39
|
+
testURL: () => false,
|
|
40
|
+
options: {pointCloudTiler: {}},
|
|
41
|
+
defaultOptions: {pointCloudTiler: {}},
|
|
42
|
+
preload: preloadPointCloudTileSource,
|
|
43
|
+
/** Direct construction requires the runtime rather than this metadata export. */
|
|
44
|
+
createDataSource(
|
|
45
|
+
_input: PointCloudTileSourceInput | string | Blob,
|
|
46
|
+
_options: PointCloudTileSourceOptions = {},
|
|
47
|
+
_coreApi?: CoreAPI
|
|
48
|
+
): PointCloudTileSource {
|
|
49
|
+
throw new Error(
|
|
50
|
+
'PointCloudTileSourceLoader requires preload() or @loaders.gl/tiles/point-cloud-tile-source-loader'
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
} as const satisfies SourceLoader<PointCloudTileSource>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {CoreAPI, SourceLoader} from '@loaders.gl/loader-utils';
|
|
6
|
+
import {PointCloudTileSource} from '@loaders.gl/tiles/point-cloud-tile-source';
|
|
7
|
+
import {PointCloudTileSourceLoader} from './point-cloud-tile-source-loader-types';
|
|
8
|
+
import type {
|
|
9
|
+
PointCloudTileSourceInput,
|
|
10
|
+
PointCloudTileSourceOptions
|
|
11
|
+
} from './point-cloud-tile-source-types';
|
|
12
|
+
|
|
13
|
+
const {
|
|
14
|
+
preload: _preload,
|
|
15
|
+
createDataSource: _createDataSource,
|
|
16
|
+
...metadata
|
|
17
|
+
} = PointCloudTileSourceLoader;
|
|
18
|
+
|
|
19
|
+
/** Parser-bearing source factory for decoded point Mesh/Arrow data. */
|
|
20
|
+
export const PointCloudTileSourceLoaderWithParser = {
|
|
21
|
+
...metadata,
|
|
22
|
+
/** Creates a native-coordinate source with deferred child indexing. */
|
|
23
|
+
createDataSource(
|
|
24
|
+
input: PointCloudTileSourceInput | string | Blob,
|
|
25
|
+
options: PointCloudTileSourceOptions = {},
|
|
26
|
+
coreApi?: CoreAPI
|
|
27
|
+
): PointCloudTileSource {
|
|
28
|
+
if (typeof input === 'string' || input instanceof Blob)
|
|
29
|
+
throw new Error('PointCloudTileSourceLoader requires decoded Mesh/Arrow input');
|
|
30
|
+
return new PointCloudTileSource(input, options, coreApi);
|
|
31
|
+
}
|
|
32
|
+
} as const satisfies SourceLoader<PointCloudTileSource>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {DataSourceOptions} from '@loaders.gl/loader-utils';
|
|
6
|
+
import type {Mesh, MeshArrowTable} from '@loaders.gl/schema';
|
|
7
|
+
import type {PointCloudTilerOptions} from '@loaders.gl/schema-utils';
|
|
8
|
+
import type {TilesetSpatialReference} from './spatial/spatial-types';
|
|
9
|
+
|
|
10
|
+
/** Decoded points supplied to the dynamic point-cloud source. */
|
|
11
|
+
export type PointCloudTileSourceInput = Mesh | MeshArrowTable;
|
|
12
|
+
|
|
13
|
+
/** Options for native-coordinate, additive dynamic point tiling. */
|
|
14
|
+
export type PointCloudTileSourceOptions = DataSourceOptions & {
|
|
15
|
+
/** Point indexing, output and lifetime controls. No CRS is inferred. */
|
|
16
|
+
pointCloudTiler?: PointCloudTilerOptions & {
|
|
17
|
+
/** Spatial metadata for the input coordinates; retained without reprojection. */
|
|
18
|
+
readonly spatialReference?: TilesetSpatialReference;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {DataSource, type CoreAPI} from '@loaders.gl/loader-utils';
|
|
6
|
+
import {
|
|
7
|
+
PointCloudTiler,
|
|
8
|
+
convertMeshToTable,
|
|
9
|
+
type PointCloudTilerNode
|
|
10
|
+
} from '@loaders.gl/schema-utils';
|
|
11
|
+
import type {
|
|
12
|
+
PointCloudTileContent,
|
|
13
|
+
PointCloudTileHeader,
|
|
14
|
+
PointCloudTilesetSource
|
|
15
|
+
} from './point-cloud/types';
|
|
16
|
+
import type {
|
|
17
|
+
PointCloudTileSourceInput,
|
|
18
|
+
PointCloudTileSourceOptions
|
|
19
|
+
} from './point-cloud-tile-source-types';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Dynamic counterpart to vector table tiling, usable by PointCloudTileset and converter traversal.
|
|
23
|
+
* Each point belongs to one additive node. It retains native coordinates and explicit CRS metadata.
|
|
24
|
+
* Geometry stays in memory; output tiles are gathered on request and are not cached by this source.
|
|
25
|
+
*/
|
|
26
|
+
export class PointCloudTileSource
|
|
27
|
+
extends DataSource<null, PointCloudTileSourceOptions>
|
|
28
|
+
implements PointCloudTilesetSource<null, PointCloudTileSourceOptions>
|
|
29
|
+
{
|
|
30
|
+
/** Resolves after the root is indexed. */
|
|
31
|
+
readonly ready: Promise<void>;
|
|
32
|
+
/** Whether root indexing has completed successfully. */
|
|
33
|
+
isReady = false;
|
|
34
|
+
/** Shared portable index and ownership implementation. */
|
|
35
|
+
private readonly tiler: PointCloudTiler;
|
|
36
|
+
|
|
37
|
+
/** Creates a source from decoded points, without fetching or reprojecting input. */
|
|
38
|
+
constructor(
|
|
39
|
+
input: PointCloudTileSourceInput,
|
|
40
|
+
options: PointCloudTileSourceOptions = {},
|
|
41
|
+
coreApi?: CoreAPI
|
|
42
|
+
) {
|
|
43
|
+
super(null, options, {pointCloudTiler: {}}, coreApi);
|
|
44
|
+
this.tiler = new PointCloudTiler(input, options.pointCloudTiler);
|
|
45
|
+
this.ready = this.tiler.getRootNode().then(() => {
|
|
46
|
+
this.isReady = true;
|
|
47
|
+
});
|
|
48
|
+
this.ready.catch(() => {});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Waits for one shared indexing operation. */
|
|
52
|
+
async initialize(): Promise<void> {
|
|
53
|
+
await this.ready;
|
|
54
|
+
await this.tiler.getRootNode();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Reports exact source count and the additive ownership contract. */
|
|
58
|
+
async getMetadata(): Promise<{pointCount: number; refinement: 'ADD'}> {
|
|
59
|
+
await this.initialize();
|
|
60
|
+
return {pointCount: this.tiler.pointCount, refinement: 'ADD'};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Returns the sampled root and its native bounds. */
|
|
64
|
+
async getRootTile(): Promise<PointCloudTileHeader> {
|
|
65
|
+
return this.createHeader(await this.tiler.getRootNode());
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Discovers only the requested node's immediate children. */
|
|
69
|
+
async getChildren(tile: PointCloudTileHeader): Promise<PointCloudTileHeader[]> {
|
|
70
|
+
return (await this.tiler.getChildNodes(tile.id)).map(node => this.createHeader(node));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Gathers the requested point rows into a fresh Arrow tile, preserving attribute types. */
|
|
74
|
+
async loadTileContent(tile: PointCloudTileHeader): Promise<PointCloudTileContent | null> {
|
|
75
|
+
const mesh = await this.tiler.getTileMesh(tile.id);
|
|
76
|
+
if (!mesh.header!.vertexCount) return null;
|
|
77
|
+
return {
|
|
78
|
+
data: convertMeshToTable(mesh, 'arrow-table'),
|
|
79
|
+
pointCount: mesh.header!.vertexCount,
|
|
80
|
+
cartographicOrigin: [0, 0, 0],
|
|
81
|
+
coordinateSystem: 'cartesian',
|
|
82
|
+
spatialReference: this.options.pointCloudTiler.spatialReference,
|
|
83
|
+
spatialBoundingVolume: this.createHeader(await this.tiler.getNodeMetadata(tile.id))
|
|
84
|
+
.boundingVolume
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Releases the input table, attributes and index; safe to repeat. */
|
|
89
|
+
close(): void {
|
|
90
|
+
this.tiler.close();
|
|
91
|
+
this.isReady = false;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Creates a conservative native-coordinate header without renderer projection math. */
|
|
95
|
+
private createHeader(node: PointCloudTilerNode): PointCloudTileHeader {
|
|
96
|
+
const center = node.bounds[0].map((value, axis) => value + (node.bounds[1][axis] - value) / 2);
|
|
97
|
+
const boundingVolume = {
|
|
98
|
+
cartographicBounds: node.bounds.map(corner => [...corner]) as [number[], number[]],
|
|
99
|
+
center,
|
|
100
|
+
radius: Math.hypot(...center.map((value, axis) => node.bounds[1][axis] - value)),
|
|
101
|
+
coordinateFrame: 'cartesian' as const
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
id: node.id,
|
|
105
|
+
level: node.level,
|
|
106
|
+
pointCount: node.pointCount,
|
|
107
|
+
geometricError: node.geometricError,
|
|
108
|
+
boundingVolume,
|
|
109
|
+
spatialBoundingVolume: boundingVolume
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -58,6 +58,14 @@ export type I3STransformedPositions = {
|
|
|
58
58
|
modelMatrix: Matrix4;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
/** Double-precision conversion geometry after I3S units, elevation and CRS placement. */
|
|
62
|
+
export type I3STransformedGeometry = {
|
|
63
|
+
/** Absolute target xyz positions, before any writer-owned float32 rebasing. */
|
|
64
|
+
positions: Float64Array;
|
|
65
|
+
/** Optional unit normals in the target basis. */
|
|
66
|
+
normals?: Float32Array;
|
|
67
|
+
};
|
|
68
|
+
|
|
61
69
|
/**
|
|
62
70
|
* Applies one normalized I3S horizontal CRS operation consistently to geometry, normals, origins,
|
|
63
71
|
* and node bounds.
|
|
@@ -308,6 +316,44 @@ export class I3SSpatialTransformer {
|
|
|
308
316
|
);
|
|
309
317
|
}
|
|
310
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Transforms conversion geometry without passing through renderer float32 offsets.
|
|
321
|
+
* Positions and normals share one batch of elevation samples. Source arrays remain unchanged.
|
|
322
|
+
* @param sourcePositions - Packed absolute xyz positions in source units.
|
|
323
|
+
* @param normals - Optional packed normals paired with the positions.
|
|
324
|
+
* @param normalReferenceFrame - I3S earth-centered or vertex-reference-frame declaration.
|
|
325
|
+
* @returns Absolute target positions and optional transformed normals.
|
|
326
|
+
*/
|
|
327
|
+
async transformGeometryAsync(
|
|
328
|
+
sourcePositions: ArrayLike<number>,
|
|
329
|
+
normals?: ArrayLike<number>,
|
|
330
|
+
normalReferenceFrame = 'earth-centered'
|
|
331
|
+
): Promise<I3STransformedGeometry> {
|
|
332
|
+
if (sourcePositions.length % 3 || (normals && normals.length !== sourcePositions.length)) {
|
|
333
|
+
throw new Error('Conversion positions and normals must contain matching finite xyz triples');
|
|
334
|
+
}
|
|
335
|
+
for (let index = 0; index < sourcePositions.length; index++) {
|
|
336
|
+
if (
|
|
337
|
+
!Number.isFinite(sourcePositions[index]) ||
|
|
338
|
+
(normals && !Number.isFinite(normals[index]))
|
|
339
|
+
) {
|
|
340
|
+
throw new Error(
|
|
341
|
+
'Conversion positions and normals must contain matching finite xyz triples'
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (!['earth-centered', 'vertex-reference-frame'].includes(normalReferenceFrame)) {
|
|
346
|
+
throw new Error('Unsupported I3S normal reference frame');
|
|
347
|
+
}
|
|
348
|
+
const placedPositions = await this.placeSourcePositions(sourcePositions);
|
|
349
|
+
return {
|
|
350
|
+
positions: this.positionTransformer.transformPositions(placedPositions),
|
|
351
|
+
normals: normals
|
|
352
|
+
? this.transformNormals(normals, placedPositions, normalReferenceFrame)
|
|
353
|
+
: undefined
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
|
|
311
357
|
/** Transform already placed positions into renderer-relative target coordinates. */
|
|
312
358
|
private transformPlacedPositions(
|
|
313
359
|
sourcePositions: ArrayLike<number>,
|
|
@@ -355,7 +401,25 @@ export class I3SSpatialTransformer {
|
|
|
355
401
|
sourcePositions: ArrayLike<number>,
|
|
356
402
|
normalReferenceFrame = 'earth-centered'
|
|
357
403
|
): Float32Array {
|
|
404
|
+
if (normals.length !== sourcePositions.length || normals.length % 3) {
|
|
405
|
+
throw new Error('I3S normals and positions must have matching xyz component counts');
|
|
406
|
+
}
|
|
358
407
|
const transformedNormals = new Float32Array(normals.length);
|
|
408
|
+
// Earth-centered I3S normals already use the output ECEF basis; no position projection is needed.
|
|
409
|
+
if (
|
|
410
|
+
normalReferenceFrame === 'earth-centered' &&
|
|
411
|
+
(this.spatialReference.targetCrs || this.spatialReference.sourceCrs) === 'EPSG:4978'
|
|
412
|
+
) {
|
|
413
|
+
for (let index = 0; index < normals.length; index += 3) {
|
|
414
|
+
const length = Math.hypot(normals[index], normals[index + 1], normals[index + 2]);
|
|
415
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
416
|
+
transformedNormals[index + axis] = length
|
|
417
|
+
? normals[index + axis] / length
|
|
418
|
+
: normals[index + axis];
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return transformedNormals;
|
|
422
|
+
}
|
|
359
423
|
for (let index = 0; index < normals.length; index += 3) {
|
|
360
424
|
const geographic = this.sourceToGeographicTransformer.transformPosition([
|
|
361
425
|
sourcePositions[index],
|
|
@@ -6,8 +6,9 @@ import type {Geoid} from '@math.gl/geoid';
|
|
|
6
6
|
import {Vector3} from '@math.gl/core';
|
|
7
7
|
import {Ellipsoid} from '@math.gl/geospatial';
|
|
8
8
|
import type {ReadonlyCRSDefinition} from '@math.gl/crs';
|
|
9
|
-
import {Projection} from '@math.gl/projection';
|
|
10
|
-
import {
|
|
9
|
+
import type {Projection} from '@math.gl/projection';
|
|
10
|
+
import {ProjectionBuffer} from '@math.gl/projection/bulk';
|
|
11
|
+
import {getGeoidModel, getSpatialProjectionEngine} from './spatial-resource-registry';
|
|
11
12
|
import {
|
|
12
13
|
normalizeCrsIdentifier,
|
|
13
14
|
WGS84_GEOCENTRIC_CRS,
|
|
@@ -35,6 +36,9 @@ export class SpatialCoordinateTransformer {
|
|
|
35
36
|
/** Projection from the source CRS directly to the requested horizontal target CRS. */
|
|
36
37
|
private readonly horizontalProjection?: Projection;
|
|
37
38
|
|
|
39
|
+
/** Reusable packed xyz projection for horizontal-only coordinate batches. */
|
|
40
|
+
private readonly horizontalProjectionBuffer?: ProjectionBuffer;
|
|
41
|
+
|
|
38
42
|
/** Projection from the source CRS to geographic longitude, latitude, and ellipsoidal height. */
|
|
39
43
|
private readonly geographicProjection?: Projection;
|
|
40
44
|
|
|
@@ -64,6 +68,7 @@ export class SpatialCoordinateTransformer {
|
|
|
64
68
|
*/
|
|
65
69
|
constructor(spatialReference: TilesetSpatialReference, options: TilesetSpatialOptions = {}) {
|
|
66
70
|
this.spatialReference = spatialReference;
|
|
71
|
+
const projectionEngine = getSpatialProjectionEngine();
|
|
67
72
|
validateTransformRequest(spatialReference);
|
|
68
73
|
const outputCrs = spatialReference.targetCrs || spatialReference.sourceCrs;
|
|
69
74
|
this.sourceIsGeocentric = isWgs84Geocentric(spatialReference.sourceCrs);
|
|
@@ -77,11 +82,17 @@ export class SpatialCoordinateTransformer {
|
|
|
77
82
|
!this.sourceIsGeocentric &&
|
|
78
83
|
!this.outputIsGeocentric
|
|
79
84
|
) {
|
|
80
|
-
this.horizontalProjection =
|
|
85
|
+
this.horizontalProjection = projectionEngine.createProjection({
|
|
81
86
|
from: getHorizontalProjectionDefinition(spatialReference.sourceCrs),
|
|
82
87
|
to: getHorizontalProjectionDefinition(spatialReference.targetCrs),
|
|
83
88
|
enforceAxis: false
|
|
84
89
|
});
|
|
90
|
+
if (!requiresHeightTransformation(spatialReference)) {
|
|
91
|
+
this.horizontalProjectionBuffer = new ProjectionBuffer({
|
|
92
|
+
projection: this.horizontalProjection,
|
|
93
|
+
dimension: 3
|
|
94
|
+
});
|
|
95
|
+
}
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
if (
|
|
@@ -90,14 +101,14 @@ export class SpatialCoordinateTransformer {
|
|
|
90
101
|
this.outputIsGeocentric
|
|
91
102
|
) {
|
|
92
103
|
if (!this.sourceIsGeographic && !this.sourceIsGeocentric) {
|
|
93
|
-
this.geographicProjection =
|
|
104
|
+
this.geographicProjection = projectionEngine.createProjection({
|
|
94
105
|
from: getHorizontalProjectionDefinition(spatialReference.sourceCrs),
|
|
95
106
|
to: WGS84_GEOGRAPHIC_CRS,
|
|
96
107
|
enforceAxis: false
|
|
97
108
|
});
|
|
98
109
|
}
|
|
99
110
|
if (!this.outputIsGeographic && !this.outputIsGeocentric) {
|
|
100
|
-
this.heightOutputProjection =
|
|
111
|
+
this.heightOutputProjection = projectionEngine.createProjection({
|
|
101
112
|
from: WGS84_GEOGRAPHIC_CRS,
|
|
102
113
|
to: getHorizontalProjectionDefinition(outputCrs),
|
|
103
114
|
enforceAxis: false
|
|
@@ -153,18 +164,28 @@ export class SpatialCoordinateTransformer {
|
|
|
153
164
|
}
|
|
154
165
|
|
|
155
166
|
if (this.horizontalProjection) {
|
|
156
|
-
const projected = this.horizontalProjection.
|
|
167
|
+
const projected = this.horizontalProjection.projectSync(result.slice(0, 3));
|
|
157
168
|
result.splice(0, projected.length, ...projected);
|
|
158
169
|
}
|
|
159
170
|
return result;
|
|
160
171
|
}
|
|
161
172
|
|
|
162
|
-
/** Transform
|
|
173
|
+
/** Transform packed xyz positions into owned Float64 storage, batching finite horizontal transforms. */
|
|
163
174
|
transformPositions(positions: ArrayLike<number>): Float64Array {
|
|
164
175
|
if (positions.length % 3 !== 0) {
|
|
165
176
|
throw new Error('Packed spatial positions must contain a multiple of three components');
|
|
166
177
|
}
|
|
167
178
|
const transformedPositions = new Float64Array(positions.length);
|
|
179
|
+
if (this.horizontalProjectionBuffer) {
|
|
180
|
+
transformedPositions.set(positions);
|
|
181
|
+
// The bulk API rejects nonfinite ordinates; preserve scalar behavior for those inputs.
|
|
182
|
+
if (transformedPositions.every(Number.isFinite)) {
|
|
183
|
+
return this.horizontalProjectionBuffer.projectFlatTo(
|
|
184
|
+
transformedPositions,
|
|
185
|
+
transformedPositions
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
168
189
|
for (let index = 0; index < positions.length; index += 3) {
|
|
169
190
|
const transformed = this.transformPosition([
|
|
170
191
|
Number(positions[index]),
|
|
@@ -220,7 +241,7 @@ export class SpatialCoordinateTransformer {
|
|
|
220
241
|
if (this.sourceIsGeographic) {
|
|
221
242
|
return coordinate.slice(0, 3);
|
|
222
243
|
}
|
|
223
|
-
return this.geographicProjection!.
|
|
244
|
+
return this.geographicProjection!.projectSync(coordinate.slice(0, 3));
|
|
224
245
|
}
|
|
225
246
|
|
|
226
247
|
/** Convert one conventional WGS84 geographic coordinate to the selected output CRS. */
|
|
@@ -231,7 +252,7 @@ export class SpatialCoordinateTransformer {
|
|
|
231
252
|
if (this.outputIsGeographic) {
|
|
232
253
|
return coordinate.slice(0, 3);
|
|
233
254
|
}
|
|
234
|
-
return this.heightOutputProjection!.
|
|
255
|
+
return this.heightOutputProjection!.projectSync(coordinate.slice(0, 3));
|
|
235
256
|
}
|
|
236
257
|
}
|
|
237
258
|
|
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {Geoid, parsePGM} from '@math.gl/geoid';
|
|
6
|
-
import {
|
|
6
|
+
import {FullProjectionEngine, parseNTv2Grid} from '@math.gl/projection';
|
|
7
|
+
import type {DatumGrid, ProjectionEngine} from '@math.gl/projection';
|
|
7
8
|
import type {ReadonlyCRSDefinition} from '@math.gl/crs';
|
|
8
9
|
|
|
9
10
|
const geoidModels = new Map<string, Geoid>();
|
|
11
|
+
const projectionAliases: Record<string, ReadonlyCRSDefinition> = {};
|
|
12
|
+
const datumGrids: Record<string, DatumGrid> = {};
|
|
13
|
+
let spatialProjectionEngine: ProjectionEngine = new FullProjectionEngine();
|
|
14
|
+
|
|
15
|
+
/** Returns the projection engine containing application-registered spatial resources. */
|
|
16
|
+
export function getSpatialProjectionEngine(): ProjectionEngine {
|
|
17
|
+
return spatialProjectionEngine;
|
|
18
|
+
}
|
|
10
19
|
|
|
11
20
|
/**
|
|
12
21
|
* Registers an application-supplied CRS alias for deterministic coordinate transformations.
|
|
@@ -18,7 +27,8 @@ const geoidModels = new Map<string, Geoid>();
|
|
|
18
27
|
*/
|
|
19
28
|
export function registerSpatialCrs(name: string, definition: ReadonlyCRSDefinition): void {
|
|
20
29
|
validateResourceName(name, 'CRS');
|
|
21
|
-
|
|
30
|
+
projectionAliases[name] = definition;
|
|
31
|
+
spatialProjectionEngine = new FullProjectionEngine({aliases: projectionAliases, datumGrids});
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
/**
|
|
@@ -29,7 +39,8 @@ export function registerSpatialCrs(name: string, definition: ReadonlyCRSDefiniti
|
|
|
29
39
|
*/
|
|
30
40
|
export function registerSpatialDatumGrid(name: string, data: ArrayBuffer): void {
|
|
31
41
|
validateResourceName(name, 'datum grid');
|
|
32
|
-
|
|
42
|
+
datumGrids[name] = parseNTv2Grid(data);
|
|
43
|
+
spatialProjectionEngine = new FullProjectionEngine({aliases: projectionAliases, datumGrids});
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
/**
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {SpatialCoordinateTransformer} from './spatial-coordinate-transformer';
|
|
6
|
-
import {getSpatialCoordinateFrame} from './get-spatial-coordinate-frame';
|
|
7
6
|
import {Matrix4} from '@math.gl/core';
|
|
8
|
-
import {Ellipsoid} from '@math.gl/geospatial';
|
|
9
7
|
import type {TilesetSpatialOptions, TilesetSpatialReference} from './spatial-types';
|
|
10
8
|
|
|
11
9
|
/** Structural 3D Tiles volume shape used by the source adapter. */
|
|
@@ -80,16 +78,6 @@ export class Tiles3DSpatialTransformer {
|
|
|
80
78
|
|
|
81
79
|
/** Transforms one WGS84 region sample into the selected output frame. */
|
|
82
80
|
private transformRegionSample(sample: number[]): number[] {
|
|
83
|
-
const [longitudeDegrees, latitudeDegrees, height] = sample;
|
|
84
|
-
const targetCrs = this.spatialReference.targetCrs || this.spatialReference.sourceCrs;
|
|
85
|
-
if (targetCrs && getSpatialCoordinateFrame(targetCrs) === 'geocentric') {
|
|
86
|
-
const cartesian = Ellipsoid.WGS84.cartographicToCartesian([
|
|
87
|
-
longitudeDegrees,
|
|
88
|
-
latitudeDegrees,
|
|
89
|
-
height
|
|
90
|
-
]);
|
|
91
|
-
return Array.from(cartesian);
|
|
92
|
-
}
|
|
93
81
|
return this.geographicCoordinateTransformer.transformPosition(sample);
|
|
94
82
|
}
|
|
95
83
|
}
|