@loaders.gl/tile-converter 3.1.8 → 3.2.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/dist/3d-tiles-attributes-worker.d.ts +28 -0
- package/dist/3d-tiles-attributes-worker.d.ts.map +1 -0
- package/dist/3d-tiles-attributes-worker.js +4 -0
- package/dist/3d-tiles-attributes-worker.js.map +7 -0
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +82 -0
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -0
- package/dist/3d-tiles-converter/3d-tiles-converter.js +268 -0
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +84 -0
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -0
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +278 -0
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +13 -0
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts.map +1 -0
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +23 -0
- package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +9 -0
- package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +1 -0
- package/dist/3d-tiles-converter/helpers/texture-atlas.js +52 -0
- package/dist/3d-tiles-converter/json-templates/tileset.d.ts +15 -0
- package/dist/3d-tiles-converter/json-templates/tileset.d.ts.map +1 -0
- package/dist/3d-tiles-converter/json-templates/tileset.js +43 -0
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +5 -0
- package/dist/converter-cli.d.ts +2 -0
- package/dist/converter-cli.d.ts.map +1 -0
- package/dist/converter-cli.js +232 -0
- package/dist/converter.min.js +68 -68
- package/dist/deps-installer/deps-installer.d.ts +14 -0
- package/dist/deps-installer/deps-installer.d.ts.map +1 -0
- package/dist/deps-installer/deps-installer.js +31 -0
- package/dist/dist.min.js +1151 -1264
- package/dist/es5/3d-tiles-attributes-worker.js +29 -0
- package/dist/es5/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +104 -44
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +34 -43
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/converter-cli.js +306 -0
- package/dist/es5/converter-cli.js.map +1 -0
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +29 -0
- package/dist/es5/i3s-attributes-worker.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js +19 -11
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +2 -2
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +271 -182
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js +71 -0
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -0
- package/dist/es5/i3s-converter/helpers/node-pages.js +47 -99
- package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +311 -245
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/index.js +0 -16
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/utils/compress-util.js +14 -17
- package/dist/es5/lib/utils/compress-util.js.map +1 -1
- package/dist/es5/lib/utils/file-utils.js +39 -14
- package/dist/es5/lib/utils/file-utils.js.map +1 -1
- package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/es5/lib/utils/queue.js +61 -0
- package/dist/es5/lib/utils/queue.js.map +1 -0
- package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
- package/dist/es5/lib/utils/write-queue.js +225 -0
- package/dist/es5/lib/utils/write-queue.js.map +1 -0
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/es5/workers/3d-tiles-attributes-worker.js +37 -0
- package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/es5/workers/i3s-attributes-worker.js +40 -0
- package/dist/es5/workers/i3s-attributes-worker.js.map +1 -0
- package/dist/esm/3d-tiles-attributes-worker.js +16 -0
- package/dist/esm/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +32 -5
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +23 -23
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/esm/converter-cli.js +230 -0
- package/dist/esm/converter-cli.js.map +1 -0
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +16 -0
- package/dist/esm/i3s-attributes-worker.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js +19 -11
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +2 -2
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +121 -62
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js +54 -0
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -0
- package/dist/esm/i3s-converter/helpers/node-pages.js +12 -4
- package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +155 -50
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/utils/compress-util.js +6 -8
- package/dist/esm/lib/utils/compress-util.js.map +1 -1
- package/dist/esm/lib/utils/file-utils.js +11 -1
- package/dist/esm/lib/utils/file-utils.js.map +1 -1
- package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/esm/lib/utils/queue.js +19 -0
- package/dist/esm/lib/utils/queue.js.map +1 -0
- package/dist/esm/lib/utils/statistic-utills.js.map +1 -1
- package/dist/esm/lib/utils/write-queue.js +88 -0
- package/dist/esm/lib/utils/write-queue.js.map +1 -0
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/esm/pgm-loader.js.map +1 -1
- package/dist/esm/workers/3d-tiles-attributes-worker.js +5 -0
- package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -0
- package/dist/esm/workers/i3s-attributes-worker.js +4 -0
- package/dist/esm/workers/i3s-attributes-worker.js.map +1 -0
- package/dist/i3s-attributes-worker.d.ts +33 -0
- package/dist/i3s-attributes-worker.d.ts.map +1 -0
- package/dist/i3s-attributes-worker.js +10 -0
- package/dist/i3s-attributes-worker.js.map +7 -0
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts +41 -0
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/coordinate-converter.js +122 -0
- package/dist/i3s-converter/helpers/create-scene-server-path.d.ts +9 -0
- package/dist/i3s-converter/helpers/create-scene-server-path.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/create-scene-server-path.js +28 -0
- package/dist/i3s-converter/helpers/geometry-attributes.d.ts +8 -0
- package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/geometry-attributes.js +177 -0
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +29 -0
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/geometry-converter.js +901 -0
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts +9 -0
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/gltf-attributes.js +56 -0
- package/dist/i3s-converter/helpers/node-debug.d.ts +8 -0
- package/dist/i3s-converter/helpers/node-debug.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/node-debug.js +114 -0
- package/dist/i3s-converter/helpers/node-pages.d.ts +117 -0
- package/dist/i3s-converter/helpers/node-pages.d.ts.map +1 -0
- package/dist/i3s-converter/helpers/node-pages.js +208 -0
- package/dist/i3s-converter/i3s-converter.d.ts +323 -0
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -0
- package/dist/i3s-converter/i3s-converter.js +1074 -0
- package/dist/i3s-converter/json-templates/layers.d.ts +95 -0
- package/dist/i3s-converter/json-templates/layers.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/layers.js +199 -0
- package/dist/i3s-converter/json-templates/metadata.d.ts +22 -0
- package/dist/i3s-converter/json-templates/metadata.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/metadata.js +25 -0
- package/dist/i3s-converter/json-templates/node.d.ts +61 -0
- package/dist/i3s-converter/json-templates/node.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/node.js +89 -0
- package/dist/i3s-converter/json-templates/scene-server.d.ts +28 -0
- package/dist/i3s-converter/json-templates/scene-server.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/scene-server.js +31 -0
- package/dist/i3s-converter/json-templates/shared-resources.d.ts +14 -0
- package/dist/i3s-converter/json-templates/shared-resources.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/shared-resources.js +129 -0
- package/dist/i3s-converter/json-templates/store.d.ts +95 -0
- package/dist/i3s-converter/json-templates/store.d.ts.map +1 -0
- package/dist/i3s-converter/json-templates/store.js +103 -0
- package/dist/i3s-converter/types.d.ts +114 -0
- package/dist/i3s-converter/types.d.ts.map +1 -0
- package/dist/i3s-converter/types.js +2 -0
- package/dist/i3s-server/app.d.ts +3 -0
- package/dist/i3s-server/app.d.ts.map +1 -0
- package/dist/i3s-server/app.js +14 -0
- package/dist/i3s-server/controllers/index-controller.d.ts +2 -0
- package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -0
- package/dist/i3s-server/controllers/index-controller.js +23 -0
- package/dist/i3s-server/routes/index.d.ts +3 -0
- package/dist/i3s-server/routes/index.d.ts.map +1 -0
- package/dist/i3s-server/routes/index.js +16 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/lib/utils/compress-util.d.ts +45 -0
- package/dist/lib/utils/compress-util.d.ts.map +1 -0
- package/dist/lib/utils/compress-util.js +257 -0
- package/dist/{esm/lib → lib}/utils/file-utils.d.ts +6 -14
- package/dist/lib/utils/file-utils.d.ts.map +1 -0
- package/dist/lib/utils/file-utils.js +81 -0
- package/dist/lib/utils/lod-conversion-utils.d.ts +41 -0
- package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -0
- package/dist/lib/utils/lod-conversion-utils.js +76 -0
- package/dist/lib/utils/queue.d.ts +7 -0
- package/dist/lib/utils/queue.d.ts.map +1 -0
- package/dist/lib/utils/queue.js +18 -0
- package/dist/lib/utils/statistic-utills.d.ts +3 -0
- package/dist/lib/utils/statistic-utills.d.ts.map +1 -0
- package/dist/lib/utils/statistic-utills.js +64 -0
- package/dist/lib/utils/write-queue.d.ts +22 -0
- package/dist/lib/utils/write-queue.d.ts.map +1 -0
- package/dist/lib/utils/write-queue.js +62 -0
- package/dist/pgm-loader.d.ts +6 -0
- package/dist/pgm-loader.d.ts.map +1 -0
- package/dist/pgm-loader.js +23 -0
- package/dist/workers/3d-tiles-attributes-worker.d.ts +2 -0
- package/dist/workers/3d-tiles-attributes-worker.d.ts.map +1 -0
- package/dist/workers/3d-tiles-attributes-worker.js +9 -0
- package/dist/workers/i3s-attributes-worker.d.ts +2 -0
- package/dist/workers/i3s-attributes-worker.d.ts.map +1 -0
- package/dist/workers/i3s-attributes-worker.js +5 -0
- package/package.json +19 -18
- package/src/3d-tiles-attributes-worker.ts +43 -0
- package/src/3d-tiles-converter/3d-tiles-converter.ts +49 -6
- package/src/3d-tiles-converter/helpers/b3dm-converter.ts +21 -18
- package/src/converter-cli.ts +310 -0
- package/src/deps-installer/{deps-installer.js → deps-installer.ts} +11 -1
- package/src/i3s-attributes-worker.ts +46 -0
- package/src/i3s-converter/helpers/coordinate-converter.ts +29 -24
- package/src/i3s-converter/helpers/geometry-attributes.ts +4 -3
- package/src/i3s-converter/helpers/{geometry-converter.js → geometry-converter.ts} +425 -179
- package/src/i3s-converter/helpers/gltf-attributes.ts +68 -0
- package/src/i3s-converter/helpers/node-pages.ts +25 -17
- package/src/i3s-converter/i3s-converter.ts +154 -87
- package/src/i3s-converter/types.ts +90 -8
- package/src/index.ts +0 -4
- package/src/lib/utils/{compress-util.js → compress-util.ts} +105 -18
- package/src/lib/utils/file-utils.ts +84 -0
- package/src/lib/utils/{lod-conversion-utils.js → lod-conversion-utils.ts} +27 -5
- package/src/lib/utils/queue.ts +17 -0
- package/src/lib/utils/{statistic-utills.js → statistic-utills.ts} +0 -0
- package/src/lib/utils/write-queue.ts +75 -0
- package/src/workers/3d-tiles-attributes-worker.ts +6 -0
- package/src/workers/i3s-attributes-worker.ts +6 -0
- package/dist/es5/deps-installer/deps-installer.d.ts +0 -10
- package/dist/es5/i3s-converter/helpers/geometry-converter.d.ts +0 -44
- package/dist/es5/lib/utils/compress-util.d.ts +0 -53
- package/dist/es5/lib/utils/file-utils.d.ts +0 -43
- package/dist/es5/lib/utils/lod-conversion-utils.d.ts +0 -32
- package/dist/esm/deps-installer/deps-installer.d.ts +0 -10
- package/dist/esm/i3s-converter/helpers/geometry-converter.d.ts +0 -44
- package/dist/esm/lib/utils/compress-util.d.ts +0 -53
- package/dist/esm/lib/utils/lod-conversion-utils.d.ts +0 -32
- package/src/deps-installer/deps-installer.d.ts +0 -10
- package/src/i3s-converter/helpers/geometry-converter.d.ts +0 -44
- package/src/lib/utils/compress-util.d.ts +0 -53
- package/src/lib/utils/file-utils.d.ts +0 -43
- package/src/lib/utils/file-utils.js +0 -38
- package/src/lib/utils/lod-conversion-utils.d.ts +0 -32
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
import type { WriteQueueItem } from '../lib/utils/write-queue';
|
|
2
|
+
import type { SceneLayer3D } from '@loaders.gl/i3s';
|
|
3
|
+
import { Tileset3D } from '@loaders.gl/tiles';
|
|
4
|
+
import { Geoid } from '@math.gl/geoid';
|
|
5
|
+
import NodePages from './helpers/node-pages';
|
|
6
|
+
import { LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
7
|
+
import { I3SMaterialDefinition } from '@loaders.gl/i3s/src/types';
|
|
8
|
+
import WriteQueue from '../lib/utils/write-queue';
|
|
9
|
+
/**
|
|
10
|
+
* Converter from 3d-tiles tileset to i3s layer
|
|
11
|
+
*/
|
|
12
|
+
export default class I3SConverter {
|
|
13
|
+
nodePages: NodePages;
|
|
14
|
+
options: any;
|
|
15
|
+
layers0Path: string;
|
|
16
|
+
materialMap: Map<any, any>;
|
|
17
|
+
materialDefinitions: I3SMaterialDefinition[];
|
|
18
|
+
vertexCounter: number;
|
|
19
|
+
layers0: SceneLayer3D | null;
|
|
20
|
+
featuresHashArray: string[];
|
|
21
|
+
refinementCounter: {
|
|
22
|
+
tilesCount: number;
|
|
23
|
+
tilesWithAddRefineCount: number;
|
|
24
|
+
};
|
|
25
|
+
validate: boolean;
|
|
26
|
+
boundingVolumeWarnings?: string[];
|
|
27
|
+
conversionStartTime: [number, number];
|
|
28
|
+
refreshTokenTime: [number, number];
|
|
29
|
+
sourceTileset: Tileset3D | null;
|
|
30
|
+
geoidHeightModel: Geoid | null;
|
|
31
|
+
Loader: LoaderWithParser;
|
|
32
|
+
generateTextures: boolean;
|
|
33
|
+
generateBoundingVolumes: boolean;
|
|
34
|
+
layersHasTexture: boolean;
|
|
35
|
+
workerSource: {
|
|
36
|
+
[key: string]: string;
|
|
37
|
+
};
|
|
38
|
+
writeQueue: WriteQueue<WriteQueueItem>;
|
|
39
|
+
constructor();
|
|
40
|
+
/**
|
|
41
|
+
* Convert a 3d tileset
|
|
42
|
+
* @param options
|
|
43
|
+
* @param options.inputUrl the url to read the tileset from
|
|
44
|
+
* @param options.outputPath the output filename
|
|
45
|
+
* @param options.tilesetName the output name of the tileset
|
|
46
|
+
* @param options.maxDepth The max tree depth of conversion
|
|
47
|
+
* @param options.slpk Generate slpk (Scene Layer Packages) output file
|
|
48
|
+
* @param options.sevenZipExe Location of 7z.exe archiver to create slpk on Windows
|
|
49
|
+
* @param options.egmFilePath location of *.pgm file to convert heights from ellipsoidal to gravity-related format
|
|
50
|
+
* @param options.token Token for Cesium ION tilesets authentication
|
|
51
|
+
* @param options.draco Generate I3S 1.7 draco compressed geometries
|
|
52
|
+
* @param options.validate -enable validation
|
|
53
|
+
*/
|
|
54
|
+
convert(options: {
|
|
55
|
+
inputUrl: string;
|
|
56
|
+
outputPath: string;
|
|
57
|
+
tilesetName: string;
|
|
58
|
+
sevenZipExe: string;
|
|
59
|
+
egmFilePath: string;
|
|
60
|
+
maxDepth?: number;
|
|
61
|
+
slpk?: boolean;
|
|
62
|
+
token?: string;
|
|
63
|
+
draco?: boolean;
|
|
64
|
+
validate?: boolean;
|
|
65
|
+
generateTextures?: boolean;
|
|
66
|
+
generateBoundingVolumes?: boolean;
|
|
67
|
+
}): Promise<any>;
|
|
68
|
+
/**
|
|
69
|
+
* Convert and save the layer and embedded tiles
|
|
70
|
+
* @param outputPath - path to save output data
|
|
71
|
+
* @param tilesetName - new tileset path
|
|
72
|
+
*/
|
|
73
|
+
private _createAndSaveTileset;
|
|
74
|
+
/**
|
|
75
|
+
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
76
|
+
* @param tilesetName - Name of layer
|
|
77
|
+
*/
|
|
78
|
+
private _formLayers0;
|
|
79
|
+
/**
|
|
80
|
+
* Convert and save the layer and embedded tiles
|
|
81
|
+
* @param boundingVolumes - mbs and obb data about node's bounding volume
|
|
82
|
+
* @return 3DNodeIndexDocument data https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md
|
|
83
|
+
*/
|
|
84
|
+
private _formRootNodeIndexDocument;
|
|
85
|
+
/**
|
|
86
|
+
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
87
|
+
* @param root0 - 3DNodeIndexDocument of root node https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md
|
|
88
|
+
* @param sourceRootTile - Source (3DTile) tile data
|
|
89
|
+
* @param parentId - node id in node pages
|
|
90
|
+
* @param boundingVolumes - mbs and obb data about node's bounding volume
|
|
91
|
+
*/
|
|
92
|
+
private _convertNodesTree;
|
|
93
|
+
/**
|
|
94
|
+
* Write 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md in file
|
|
95
|
+
*/
|
|
96
|
+
private _writeLayers0;
|
|
97
|
+
/**
|
|
98
|
+
* Write 3DNodeIndexDocument https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md in file
|
|
99
|
+
*/
|
|
100
|
+
private _writeNodeIndexDocument;
|
|
101
|
+
/**
|
|
102
|
+
* Pack files into *.slpk archive
|
|
103
|
+
* @param tilesetPath - Path to save file
|
|
104
|
+
*/
|
|
105
|
+
private _createSlpk;
|
|
106
|
+
/**
|
|
107
|
+
* Add child nodes recursively and write them to files
|
|
108
|
+
* @param data - arguments
|
|
109
|
+
* @param data.sourceTiles - array of source child nodes
|
|
110
|
+
* @param data.parentNode - 3DNodeIndexDocument of parent node for processing child nodes
|
|
111
|
+
* @param data.parentId - id of parent node in node pages
|
|
112
|
+
* @param data.level - level of node (distanse to root node in the tree)
|
|
113
|
+
*/
|
|
114
|
+
private _addChildrenWithNeighborsAndWriteFile;
|
|
115
|
+
/**
|
|
116
|
+
* Add child nodes recursively and write them to files
|
|
117
|
+
* @param data - arguments
|
|
118
|
+
* @param data.childNodes - array of target child nodes
|
|
119
|
+
* @param data.sourceTiles - array of source child nodes
|
|
120
|
+
* @param data.parentNode - 3DNodeIndexDocument of parent node for processing child nodes
|
|
121
|
+
* @param data.parentId - id of parent node in node pages
|
|
122
|
+
* @param data.level - level of node (distanse to root node in the tree)
|
|
123
|
+
*/
|
|
124
|
+
private _addChildren;
|
|
125
|
+
/**
|
|
126
|
+
* Add neightbors to 3DNodeIndexDocument and write it in a file
|
|
127
|
+
* @param parentNode - arguments
|
|
128
|
+
* @param childNodes - array of target child nodes
|
|
129
|
+
*/
|
|
130
|
+
private _addNeighborsAndWriteFile;
|
|
131
|
+
/**
|
|
132
|
+
* Convert tile to one or more I3S nodes
|
|
133
|
+
* @param parentTile - parent 3DNodeIndexDocument
|
|
134
|
+
* @param sourceTile - source tile (3DTile)
|
|
135
|
+
* @param parentId - id of parent node in node pages
|
|
136
|
+
* @param level - level of node (distanse to root node in the tree)
|
|
137
|
+
*/
|
|
138
|
+
private _createNode;
|
|
139
|
+
/**
|
|
140
|
+
* Convert attributesStorageInfo https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md
|
|
141
|
+
* from B3DM batch table
|
|
142
|
+
* @param sourceTileContent - tile content of 3DTile
|
|
143
|
+
* @return {void}
|
|
144
|
+
*/
|
|
145
|
+
private _convertAttributeStorageInfo;
|
|
146
|
+
/**
|
|
147
|
+
* Convert tile to one or more I3S nodes
|
|
148
|
+
* @param sourceTile - source tile (3DTile)
|
|
149
|
+
* result.geometry - ArrayBuffer with geometry attributes
|
|
150
|
+
* result.compressedGeometry - ArrayBuffer with compressed (draco) geometry
|
|
151
|
+
* result.texture - texture image
|
|
152
|
+
* result.sharedResources - shared resource data object
|
|
153
|
+
* result.meshMaterial - PBR-like material object
|
|
154
|
+
* result.vertexCount - number of vertices in geometry
|
|
155
|
+
* result.attributes - feature attributes
|
|
156
|
+
* result.featureCount - number of features
|
|
157
|
+
*/
|
|
158
|
+
private _convertResources;
|
|
159
|
+
/**
|
|
160
|
+
* Create a new node object (https://github.com/Esri/i3s-spec/blob/master/docs/1.7/node.cmn.md)
|
|
161
|
+
* in node pages (https://github.com/Esri/i3s-spec/blob/master/docs/1.7/nodePage.cmn.md)
|
|
162
|
+
* @param maxScreenThresholdSQ - Level of Details (LOD) metric
|
|
163
|
+
* @param boundingVolumes - Bounding volumes
|
|
164
|
+
* @param sourceTile - source tile (3DTile)
|
|
165
|
+
* @param parentId - id of parent node in node pages
|
|
166
|
+
* @param resources - the node resources data
|
|
167
|
+
* @param resources.meshMaterial - PBR-like material object
|
|
168
|
+
* @param resources.texture - texture image
|
|
169
|
+
* @param resources.vertexCount - number of vertices in geometry
|
|
170
|
+
* @param resources.featureCount - number of features
|
|
171
|
+
* @return the node object in node pages
|
|
172
|
+
*/
|
|
173
|
+
private _createNodeInNodePages;
|
|
174
|
+
/**
|
|
175
|
+
* Create a new node page object in node pages
|
|
176
|
+
* @param parentNode - 3DNodeIndexDocument https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md object of the parent node
|
|
177
|
+
* @param boundingVolumes - Bounding volumes
|
|
178
|
+
* @param lodSelection - Level of Details (LOD) metrics
|
|
179
|
+
* @param nodeInPage - corresponding node object in a node page
|
|
180
|
+
* @param resources - the node resources data
|
|
181
|
+
* @param resources.texture - texture image
|
|
182
|
+
* @param resources.attributes - feature attributes
|
|
183
|
+
* @return 3DNodeIndexDocument https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DNodeIndexDocument.cmn.md object
|
|
184
|
+
*/
|
|
185
|
+
private _createNodeIndexDocument;
|
|
186
|
+
/**
|
|
187
|
+
* Write node resources in files
|
|
188
|
+
* @param resources - source tile (3DTile)
|
|
189
|
+
* @param resources.geometry - Uint8Array with geometry attributes
|
|
190
|
+
* @param resources.compressedGeometry - Uint8Array with compressed (draco) geometry
|
|
191
|
+
* @param resources.texture - texture image
|
|
192
|
+
* @param resources.sharedResources - shared resource data object
|
|
193
|
+
* @param resources.attributes - feature attributes
|
|
194
|
+
* @return {Promise<void>}
|
|
195
|
+
*/
|
|
196
|
+
private _writeResources;
|
|
197
|
+
/**
|
|
198
|
+
* Write non-compressed and compressed geometries in files
|
|
199
|
+
* @param geometryBuffer - Uint8Array with geometry attributes
|
|
200
|
+
* @param compressedGeometry - Uint8Array with compressed (draco) geometry
|
|
201
|
+
* @param childPath - a child path to write resources
|
|
202
|
+
* @param slpkChildPath - resource path inside *slpk file
|
|
203
|
+
*/
|
|
204
|
+
private _writeGeometries;
|
|
205
|
+
/**
|
|
206
|
+
* Write shared resources in a file
|
|
207
|
+
* @param sharedResources - shared resource data object
|
|
208
|
+
* @param childPath - a child path to write resources
|
|
209
|
+
* @param slpkChildPath - resource path inside *slpk file
|
|
210
|
+
* @param nodePath - a node path
|
|
211
|
+
*/
|
|
212
|
+
private _writeShared;
|
|
213
|
+
/**
|
|
214
|
+
* Generates textures based on texture mime type and fill in textureSetDefinitions data.
|
|
215
|
+
* @param texture - the texture image
|
|
216
|
+
* @param childPath - a child path to write resources
|
|
217
|
+
* @param slpkChildPath - the resource path inside *slpk file
|
|
218
|
+
*/
|
|
219
|
+
private _writeTexture;
|
|
220
|
+
/**
|
|
221
|
+
* Write the texture image in a file
|
|
222
|
+
* @param textureData
|
|
223
|
+
* @param name
|
|
224
|
+
* @param format
|
|
225
|
+
* @param childPath
|
|
226
|
+
* @param slpkChildPath
|
|
227
|
+
*/
|
|
228
|
+
private writeTextureFile;
|
|
229
|
+
/**
|
|
230
|
+
* Write feature attributes in files
|
|
231
|
+
* @param attributes - feature attributes
|
|
232
|
+
* @param childPath - a child path to write resources
|
|
233
|
+
* @param slpkChildPath - the resource path inside *slpk file
|
|
234
|
+
*/
|
|
235
|
+
private _writeAttributes;
|
|
236
|
+
/**
|
|
237
|
+
* Return file format by its MIME type
|
|
238
|
+
* @param mimeType - feature attributes
|
|
239
|
+
*/
|
|
240
|
+
private _getFormatByMimeType;
|
|
241
|
+
/**
|
|
242
|
+
* Find or create material in materialDefinitions array
|
|
243
|
+
* @param material - end-to-end index of the node
|
|
244
|
+
* @return material id
|
|
245
|
+
*/
|
|
246
|
+
private _findOrCreateMaterial;
|
|
247
|
+
/**
|
|
248
|
+
* Generate storage attribute for map segmentation.
|
|
249
|
+
* @param attributeIndex - order index of attribute (f_0, f_1 ...).
|
|
250
|
+
* @param key - attribute key from batch table.\
|
|
251
|
+
* @param attributeType - attribute type.
|
|
252
|
+
* @return Updated storageAttribute.
|
|
253
|
+
*/
|
|
254
|
+
private _createdStorageAttribute;
|
|
255
|
+
/**
|
|
256
|
+
* Get the attribute type for attributeStorageInfo https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md
|
|
257
|
+
* @param key - attribute's key
|
|
258
|
+
* @param attribute - attribute's type in batchTable
|
|
259
|
+
*/
|
|
260
|
+
private getAttributeType;
|
|
261
|
+
/**
|
|
262
|
+
* Setup storage attribute as string.
|
|
263
|
+
* @param storageAttribute - attribute for map segmentation.
|
|
264
|
+
*/
|
|
265
|
+
private _setupStringAttribute;
|
|
266
|
+
/**
|
|
267
|
+
* Setup Id attribute for map segmentation.
|
|
268
|
+
* @param storageAttribute - attribute for map segmentation .
|
|
269
|
+
*/
|
|
270
|
+
private _setupIdAttribute;
|
|
271
|
+
/**
|
|
272
|
+
* Setup double attribute for map segmentation.
|
|
273
|
+
* @param storageAttribute - attribute for map segmentation .
|
|
274
|
+
*/
|
|
275
|
+
private _setupDoubleAttribute;
|
|
276
|
+
/**
|
|
277
|
+
* Setup field attribute for map segmentation.
|
|
278
|
+
* @param key - attribute for map segmentation.
|
|
279
|
+
* @param fieldAttributeType - esri attribute type ('esriFieldTypeString' or 'esriFieldTypeOID').
|
|
280
|
+
*/
|
|
281
|
+
private _createFieldAttribute;
|
|
282
|
+
/**
|
|
283
|
+
* Do conversion of 3DTiles batch table to I3s node attributes.
|
|
284
|
+
* @param batchTable - Table with layer meta data.
|
|
285
|
+
*/
|
|
286
|
+
private _convertBatchTableInfoToNodeAttributes;
|
|
287
|
+
/**
|
|
288
|
+
* Find and return attribute type based on key form Batch table.
|
|
289
|
+
* @param attributeType
|
|
290
|
+
*/
|
|
291
|
+
private _getFieldAttributeType;
|
|
292
|
+
/**
|
|
293
|
+
* Generate popup info to show metadata on the map.
|
|
294
|
+
* @param batchTable - Batch table data with OBJECTID.
|
|
295
|
+
* @return data for correct rendering of popup.
|
|
296
|
+
*/
|
|
297
|
+
private _createPopupInfo;
|
|
298
|
+
/**
|
|
299
|
+
* Print statistics in the end of conversion
|
|
300
|
+
* @param params - output files data
|
|
301
|
+
*/
|
|
302
|
+
private _finishConversion;
|
|
303
|
+
/**
|
|
304
|
+
* Fetch preload options for ION tileset
|
|
305
|
+
*/
|
|
306
|
+
private _fetchPreloadOptions;
|
|
307
|
+
/**
|
|
308
|
+
* Update options of source tileset
|
|
309
|
+
*/
|
|
310
|
+
private _updateTilesetOptions;
|
|
311
|
+
/** Do calculations of all tiles and tiles with "ADD" type of refinement.
|
|
312
|
+
* @param tile
|
|
313
|
+
*/
|
|
314
|
+
private _checkAddRefinementTypeForTile;
|
|
315
|
+
/**
|
|
316
|
+
* Check if the tile's content format is supported by the converter
|
|
317
|
+
* @param sourceRootTile
|
|
318
|
+
* @returns
|
|
319
|
+
*/
|
|
320
|
+
private isContentSupported;
|
|
321
|
+
private loadWorkers;
|
|
322
|
+
}
|
|
323
|
+
//# sourceMappingURL=i3s-converter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAEV,YAAY,EAYb,MAAM,iBAAiB,CAAC;AA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