@loaders.gl/tile-converter 4.3.0-alpha.7 → 4.3.0-beta.1

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.
Files changed (45) hide show
  1. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +3 -0
  2. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
  3. package/dist/3d-tiles-converter/3d-tiles-converter.js +15 -11
  4. package/dist/3d-tiles-converter/helpers/{b3dm-converter.d.ts → 3d-tiles-content-converter.d.ts} +13 -6
  5. package/dist/3d-tiles-converter/helpers/3d-tiles-content-converter.d.ts.map +1 -0
  6. package/dist/3d-tiles-converter/helpers/{b3dm-converter.js → 3d-tiles-content-converter.js} +110 -17
  7. package/dist/3d-tiles-converter/helpers/load-i3s.d.ts.map +1 -1
  8. package/dist/converter-cli.js +15 -0
  9. package/dist/converter.min.cjs +95 -95
  10. package/dist/deps-installer/deps-installer.js +1 -1
  11. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +2 -2
  12. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  13. package/dist/i3s-converter/helpers/batch-ids-extensions.js +1 -1
  14. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
  15. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  16. package/dist/i3s-converter/helpers/load-3d-tiles.d.ts.map +1 -1
  17. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
  18. package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +1 -2
  19. package/dist/i3s-converter/helpers/tileset-traversal.d.ts +3 -3
  20. package/dist/i3s-converter/helpers/tileset-traversal.d.ts.map +1 -1
  21. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  22. package/dist/i3s-converter/i3s-converter.js +1 -0
  23. package/dist/i3s-server/bin/i3s-server.min.cjs +70 -70
  24. package/dist/i3s-server/bin/www.js +2 -0
  25. package/dist/i3s-server/utils/server-utils.d.ts +0 -3
  26. package/dist/i3s-server/utils/server-utils.d.ts.map +1 -1
  27. package/dist/index.cjs +130 -34
  28. package/dist/index.cjs.map +4 -4
  29. package/dist/lib/utils/conversion-dump.d.ts +1 -0
  30. package/dist/lib/utils/conversion-dump.d.ts.map +1 -1
  31. package/dist/lib/utils/conversion-dump.js +3 -2
  32. package/dist/pgm-loader.d.ts.map +1 -1
  33. package/dist/pgm-loader.js +1 -1
  34. package/package.json +20 -20
  35. package/src/3d-tiles-converter/3d-tiles-converter.ts +40 -14
  36. package/src/3d-tiles-converter/helpers/{b3dm-converter.ts → 3d-tiles-content-converter.ts} +157 -21
  37. package/src/converter-cli.ts +22 -0
  38. package/src/i3s-converter/helpers/batch-ids-extensions.ts +6 -6
  39. package/src/i3s-converter/helpers/geometry-converter.ts +6 -2
  40. package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +2 -2
  41. package/src/i3s-converter/i3s-converter.ts +1 -0
  42. package/src/i3s-server/README.md +2 -0
  43. package/src/i3s-server/bin/www.ts +2 -0
  44. package/src/lib/utils/conversion-dump.ts +5 -2
  45. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +0 -1
@@ -14,6 +14,7 @@ export type ConversionDumpOptions = {
14
14
  generateBoundingVolumes: boolean;
15
15
  metadataClass: string;
16
16
  analyze: boolean;
17
+ outputVersion: string;
17
18
  };
18
19
  type NodeDoneStatus = {
19
20
  nodeId: number | string;
@@ -1 +1 @@
1
- {"version":3,"file":"conversion-dump.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/conversion-dump.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAAE,2BAA2B,EAAC,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAC,2BAA2B,EAAC,+DAA4D;AAKhG,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAA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AY;IASpF;;;OAGG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM;IAIhC;;;OAGG;IACH,sBAAsB,CAAC,kBAAkB,EAAE,oBAAoB,EAAE;IAIjE;;;;;;OAMG;IACH,gBAAgB,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,OAAO;IAgBhB;;;;OAIG;IACG,wBAAwB,CAC5B,cAAc,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAC,EAAE,EACxF,YAAY,EAAE,oBAAoB,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAClD,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAsBnB;;;;;OAKG;IACG,4BAA4B,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;OAIG;IACH,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAWnD;;;OAGG;IACH,uBAAuB,CAAC,mBAAmB,EAAE,qBAAqB,EAAE,GAAG,IAAI;CAG5E"}
@@ -26,7 +26,7 @@ export class ConversionDump {
26
26
  * @param currentOptions - converter options
27
27
  */
28
28
  async createDump(currentOptions) {
29
- const { tilesetName, slpk, egmFilePath, inputUrl, outputPath, draco = true, maxDepth, token, generateTextures, generateBoundingVolumes, mergeMaterials = true, metadataClass, analyze = false } = currentOptions;
29
+ const { tilesetName, slpk, egmFilePath, inputUrl, outputPath, draco = true, maxDepth, token, generateTextures, generateBoundingVolumes, mergeMaterials = true, metadataClass, analyze = false, outputVersion = '1.1' } = currentOptions;
30
30
  this.options = {
31
31
  tilesetName,
32
32
  slpk,
@@ -40,7 +40,8 @@ export class ConversionDump {
40
40
  generateBoundingVolumes,
41
41
  mergeMaterials,
42
42
  metadataClass,
43
- analyze
43
+ analyze,
44
+ outputVersion
44
45
  };
45
46
  const dumpFilename = join(this.options.outputPath, this.options.tilesetName, `${this.options.tilesetName}${DUMP_FILE_SUFFIX}`);
46
47
  if (await isFileExists(dumpFilename)) {
@@ -1 +1 @@
1
- {"version":3,"file":"pgm-loader.d.ts","sourceRoot":"","sources":["../src/pgm-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAC,KAAK,EAAW,MAAM,gBAAgB,CAAC;AAM/C,OAAO,EAAC,KAAK,EAAC,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE;QACJ,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;CAgB+C,CAAC"}
1
+ {"version":3,"file":"pgm-loader.d.ts","sourceRoot":"","sources":["../src/pgm-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAC,KAAK,EAAW,MAAM,gBAAgB,CAAC;AAM/C,OAAO,EAAC,KAAK,EAAC,CAAC;AAEf,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE;QACJ,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;uBACS,KAAK;wBACf,KAAK;;;;;;;;;;;;;CAc2C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { Geoid, parsePGM } from '@math.gl/geoid';
2
2
  // __VERSION__ is injected by babel-plugin-version-inline
3
3
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
4
- const VERSION = typeof "4.3.0-alpha.6" !== 'undefined' ? "4.3.0-alpha.6" : 'latest';
4
+ const VERSION = typeof "4.3.0-alpha.8" !== 'undefined' ? "4.3.0-alpha.8" : 'latest';
5
5
  export { Geoid };
6
6
  /**
7
7
  * Loader for PGM - Netpbm grayscale image format
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/tile-converter",
3
- "version": "4.3.0-alpha.7",
3
+ "version": "4.3.0-beta.1",
4
4
  "description": "Converter",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,24 +51,24 @@
51
51
  "copy-certificates": "cp -R src/i3s-server/certs dist/i3s-server"
52
52
  },
53
53
  "dependencies": {
54
- "@loaders.gl/3d-tiles": "4.3.0-alpha.7",
55
- "@loaders.gl/compression": "4.3.0-alpha.7",
56
- "@loaders.gl/crypto": "4.3.0-alpha.7",
57
- "@loaders.gl/draco": "4.3.0-alpha.7",
58
- "@loaders.gl/gltf": "4.3.0-alpha.7",
59
- "@loaders.gl/i3s": "4.3.0-alpha.7",
60
- "@loaders.gl/images": "4.3.0-alpha.7",
61
- "@loaders.gl/loader-utils": "4.3.0-alpha.7",
62
- "@loaders.gl/math": "4.3.0-alpha.7",
63
- "@loaders.gl/polyfills": "4.3.0-alpha.7",
64
- "@loaders.gl/textures": "4.3.0-alpha.7",
65
- "@loaders.gl/tiles": "4.3.0-alpha.7",
66
- "@loaders.gl/worker-utils": "4.3.0-alpha.7",
67
- "@loaders.gl/zip": "4.3.0-alpha.7",
68
- "@math.gl/core": "^4.0.0",
69
- "@math.gl/culling": "^4.0.0",
70
- "@math.gl/geoid": "^4.0.0",
71
- "@math.gl/geospatial": "^4.0.0",
54
+ "@loaders.gl/3d-tiles": "4.3.0-beta.1",
55
+ "@loaders.gl/compression": "4.3.0-beta.1",
56
+ "@loaders.gl/crypto": "4.3.0-beta.1",
57
+ "@loaders.gl/draco": "4.3.0-beta.1",
58
+ "@loaders.gl/gltf": "4.3.0-beta.1",
59
+ "@loaders.gl/i3s": "4.3.0-beta.1",
60
+ "@loaders.gl/images": "4.3.0-beta.1",
61
+ "@loaders.gl/loader-utils": "4.3.0-beta.1",
62
+ "@loaders.gl/math": "4.3.0-beta.1",
63
+ "@loaders.gl/polyfills": "4.3.0-beta.1",
64
+ "@loaders.gl/textures": "4.3.0-beta.1",
65
+ "@loaders.gl/tiles": "4.3.0-beta.1",
66
+ "@loaders.gl/worker-utils": "4.3.0-beta.1",
67
+ "@loaders.gl/zip": "4.3.0-beta.1",
68
+ "@math.gl/core": "^4.1.0",
69
+ "@math.gl/culling": "^4.1.0",
70
+ "@math.gl/geoid": "^4.1.0",
71
+ "@math.gl/geospatial": "^4.1.0",
72
72
  "ajv": "^8.12.0",
73
73
  "archiver": "^5.0.0",
74
74
  "cors": "^2.8.5",
@@ -93,5 +93,5 @@
93
93
  "peerDependencies": {
94
94
  "@loaders.gl/core": "^4.0.0"
95
95
  },
96
- "gitHead": "73fb27872d89f3804dca37ebd568c6ba9609a98f"
96
+ "gitHead": "992d24e7d4e3015a91fa1cbfe87ee7dc1b333322"
97
97
  }
@@ -2,7 +2,8 @@ import type {
2
2
  AttributeStorageInfo,
3
3
  FeatureAttribute,
4
4
  NodeReference,
5
- I3STilesetHeader
5
+ I3STilesetHeader,
6
+ I3STileAttributes
6
7
  } from '@loaders.gl/i3s';
7
8
  import type {Tile3DBoundingVolume, Tiles3DTileJSON} from '@loaders.gl/3d-tiles';
8
9
 
@@ -22,7 +23,10 @@ import {TILESET as tilesetTemplate} from './json-templates/tileset';
22
23
  import {createObbFromMbs} from '../i3s-converter/helpers/coordinate-converter';
23
24
  import {WorkerFarm} from '@loaders.gl/worker-utils';
24
25
  import {BROWSER_ERROR_MESSAGE} from '../constants';
25
- import B3dmConverter, {I3SAttributesData} from './helpers/b3dm-converter';
26
+ import {
27
+ Tiles3DContentConverter,
28
+ type I3SAttributesData
29
+ } from './helpers/3d-tiles-content-converter';
26
30
  import {I3STileHeader} from '@loaders.gl/i3s/src/types';
27
31
  import {getNodeCount, loadFromArchive, loadI3SContent, openSLPK} from './helpers/load-i3s';
28
32
  import {I3SLoaderOptions} from '@loaders.gl/i3s/src/i3s-loader';
@@ -59,6 +63,7 @@ export default class Tiles3DConverter {
59
63
  };
60
64
  conversionDump: ConversionDump;
61
65
  progress: Progress;
66
+ fileExt: string;
62
67
 
63
68
  constructor() {
64
69
  this.options = {};
@@ -71,6 +76,7 @@ export default class Tiles3DConverter {
71
76
  this.workerSource = {};
72
77
  this.conversionDump = new ConversionDump();
73
78
  this.progress = new Progress();
79
+ this.fileExt = '';
74
80
  }
75
81
 
76
82
  /**
@@ -78,6 +84,7 @@ export default class Tiles3DConverter {
78
84
  * @param options
79
85
  * @param options.inputUrl the url to read the tileset from
80
86
  * @param options.outputPath the output filename
87
+ * @param options.outputVersion the version of 3DTiles
81
88
  * @param options.tilesetName the output name of the tileset
82
89
  * @param options.egmFilePath location of *.pgm file to convert heights from ellipsoidal to gravity-related format
83
90
  * @param options.maxDepth The max tree depth of conversion
@@ -87,6 +94,7 @@ export default class Tiles3DConverter {
87
94
  inputUrl: string;
88
95
  outputPath: string;
89
96
  tilesetName: string;
97
+ outputVersion?: string;
90
98
  maxDepth?: number;
91
99
  egmFilePath: string;
92
100
  inquirer?: {prompt: PromptModule};
@@ -96,9 +104,19 @@ export default class Tiles3DConverter {
96
104
  console.log(BROWSER_ERROR_MESSAGE); // eslint-disable-line no-console
97
105
  return BROWSER_ERROR_MESSAGE;
98
106
  }
99
- const {inputUrl, outputPath, tilesetName, maxDepth, egmFilePath, inquirer, analyze} = options;
107
+ const {
108
+ inputUrl,
109
+ outputPath,
110
+ outputVersion,
111
+ tilesetName,
112
+ maxDepth,
113
+ egmFilePath,
114
+ inquirer,
115
+ analyze
116
+ } = options;
100
117
  this.conversionStartTime = process.hrtime();
101
- this.options = {maxDepth, inquirer};
118
+ this.options = {maxDepth, inquirer, outputVersion};
119
+ this.fileExt = this.options.outputVersion === '1.0' ? 'b3dm' : 'glb';
102
120
 
103
121
  console.log('Loading egm file...'); // eslint-disable-line
104
122
  this.geoidHeightModel = await load(egmFilePath, PGMLoader);
@@ -173,7 +191,7 @@ export default class Tiles3DConverter {
173
191
 
174
192
  await this._addChildren(rootNode, rootTile, 1);
175
193
 
176
- const tileset = transform({root: rootTile}, tilesetTemplate());
194
+ const tileset = transform({asset: {version: outputVersion}, root: rootTile}, tilesetTemplate());
177
195
  await writeFile(this.tilesetPath, JSON.stringify(tileset), 'tileset.json');
178
196
  await this.conversionDump.deleteDumpFile();
179
197
 
@@ -244,7 +262,7 @@ export default class Tiles3DConverter {
244
262
  if (sourceChild.contentUrl) {
245
263
  if (
246
264
  this.conversionDump.restored &&
247
- this.conversionDump.isFileConversionComplete(`${sourceChild.id}.b3dm`) &&
265
+ this.conversionDump.isFileConversionComplete(`${sourceChild.id}.${this.fileExt}`) &&
248
266
  (sourceChild.obb || sourceChild.mbs)
249
267
  ) {
250
268
  const {child} = this._createChildAndBoundingVolume(sourceChild);
@@ -266,7 +284,7 @@ export default class Tiles3DConverter {
266
284
 
267
285
  this.vertexCounter += content?.vertexCount || 0;
268
286
 
269
- let featureAttributes: FeatureAttribute | null = null;
287
+ let featureAttributes: I3STileAttributes | null = null;
270
288
  if (this.attributeStorageInfo) {
271
289
  featureAttributes = await this._loadChildAttributes(sourceChild, this.attributeStorageInfo);
272
290
  }
@@ -279,13 +297,21 @@ export default class Tiles3DConverter {
279
297
  textureFormat: sourceChild.textureFormat
280
298
  };
281
299
 
282
- const b3dmConverter = new B3dmConverter();
283
- const b3dm = await b3dmConverter.convert(i3sAttributesData, featureAttributes);
300
+ const converter = new Tiles3DContentConverter({outputVersion: this.options.outputVersion});
301
+ const contentData = await converter.convert(
302
+ i3sAttributesData,
303
+ featureAttributes,
304
+ this.attributeStorageInfo
305
+ );
284
306
 
285
- await this.conversionDump.addNode(`${sourceChild.id}.b3dm`, sourceChild.id);
286
- await writeFile(this.tilesetPath, new Uint8Array(b3dm), `${sourceChild.id}.b3dm`);
307
+ await this.conversionDump.addNode(`${sourceChild.id}.${this.fileExt}`, sourceChild.id);
308
+ await writeFile(
309
+ this.tilesetPath,
310
+ new Uint8Array(contentData),
311
+ `${sourceChild.id}.${this.fileExt}`
312
+ );
287
313
  await this.conversionDump.updateConvertedNodesDumpFile(
288
- `${sourceChild.id}.b3dm`,
314
+ `${sourceChild.id}.${this.fileExt}`,
289
315
  sourceChild.id,
290
316
  true
291
317
  );
@@ -379,7 +405,7 @@ export default class Tiles3DConverter {
379
405
  geometricError: convertScreenThresholdToGeometricError(sourceChild),
380
406
  children: [],
381
407
  content: {
382
- uri: `${sourceChild.id}.b3dm`,
408
+ uri: `${sourceChild.id}.${this.fileExt}`,
383
409
  boundingVolume
384
410
  }
385
411
  };
@@ -417,7 +443,7 @@ export default class Tiles3DConverter {
417
443
  private async _loadChildAttributes(
418
444
  sourceChild: I3STileHeader,
419
445
  attributeStorageInfo: AttributeStorageInfo[]
420
- ): Promise<FeatureAttribute> {
446
+ ): Promise<I3STileAttributes> {
421
447
  const promises: any[] = [];
422
448
  const {attributeUrls = []} = sourceChild;
423
449
 
@@ -1,8 +1,15 @@
1
- import type {I3STileContent} from '@loaders.gl/i3s';
1
+ import type {I3STileContent, AttributeStorageInfo, I3STileAttributes} from '@loaders.gl/i3s';
2
2
  import {encodeSync} from '@loaders.gl/core';
3
- import {GLTFScenegraph, GLTFWriter} from '@loaders.gl/gltf';
4
- import {Tile3DWriter} from '@loaders.gl/3d-tiles';
3
+ import {
4
+ GLTFScenegraph,
5
+ GLTFWriter,
6
+ createExtStructuralMetadata,
7
+ createExtMeshFeatures,
8
+ type PropertyAttribute
9
+ } from '@loaders.gl/gltf';
10
+ import {Tile3DWriter, TILE3D_TYPE} from '@loaders.gl/3d-tiles';
5
11
  import {Matrix4, Vector3} from '@math.gl/core';
12
+ import {isTypedArray} from '@math.gl/types';
6
13
  import {Ellipsoid} from '@math.gl/geospatial';
7
14
  import {convertTextureAtlas} from './texture-atlas';
8
15
  import {generateSyntheticIndices} from '../../lib/utils/geometry-utils';
@@ -20,12 +27,18 @@ export type I3SAttributesData = {
20
27
  };
21
28
 
22
29
  /**
23
- * Converts content of an I3S node to *.b3dm's file content
30
+ * Converts content of an I3S node to 3D Tiles file content
24
31
  */
25
- export default class B3dmConverter {
32
+ export class Tiles3DContentConverter {
26
33
  // @ts-expect-error
27
34
  rtcCenter: Float32Array;
28
35
  i3sTile: any;
36
+ tileType: string;
37
+
38
+ constructor(options: {outputVersion: string} = {outputVersion: '1.1'}) {
39
+ this.tileType =
40
+ options.outputVersion === '1.0' ? TILE3D_TYPE.BATCHED_3D_MODEL : TILE3D_TYPE.GLTF;
41
+ }
29
42
 
30
43
  /**
31
44
  * The starter of content conversion
@@ -34,19 +47,24 @@ export default class B3dmConverter {
34
47
  */
35
48
  async convert(
36
49
  i3sAttributesData: I3SAttributesData,
37
- featureAttributes: any = null
50
+ featureAttributes: I3STileAttributes | null = null,
51
+ attributeStorageInfo?: AttributeStorageInfo[] | null | undefined
38
52
  ): Promise<ArrayBuffer> {
39
- const gltf = await this.buildGLTF(i3sAttributesData, featureAttributes);
40
- const b3dm = encodeSync(
41
- {
42
- gltfEncoded: new Uint8Array(gltf),
43
- type: 'b3dm',
44
- featuresLength: this._getFeaturesLength(featureAttributes),
45
- batchTable: featureAttributes
46
- },
47
- Tile3DWriter
48
- );
49
- return b3dm;
53
+ const gltf = await this.buildGLTF(i3sAttributesData, featureAttributes, attributeStorageInfo);
54
+
55
+ if (this.tileType === TILE3D_TYPE.BATCHED_3D_MODEL) {
56
+ const b3dm = encodeSync(
57
+ {
58
+ gltfEncoded: new Uint8Array(gltf),
59
+ type: 'b3dm',
60
+ featuresLength: this._getFeaturesLength(featureAttributes),
61
+ batchTable: featureAttributes
62
+ },
63
+ Tile3DWriter
64
+ );
65
+ return b3dm;
66
+ }
67
+ return gltf;
50
68
  }
51
69
 
52
70
  /**
@@ -54,10 +72,11 @@ export default class B3dmConverter {
54
72
  * @param i3sTile - Tile3D instance for I3S node
55
73
  * @returns - encoded glb content
56
74
  */
57
- // eslint-disable-next-line max-statements
75
+ // eslint-disable-next-line complexity, max-statements
58
76
  async buildGLTF(
59
77
  i3sAttributesData: I3SAttributesData,
60
- featureAttributes: any
78
+ featureAttributes: I3STileAttributes | null,
79
+ attributeStorageInfo?: AttributeStorageInfo[] | null | undefined
61
80
  ): Promise<ArrayBuffer> {
62
81
  const {tileContent, textureFormat, box} = i3sAttributesData;
63
82
  const {material, attributes, indices: originalIndices, modelMatrix} = tileContent;
@@ -105,6 +124,7 @@ export default class B3dmConverter {
105
124
  cartographicOrigin,
106
125
  modelMatrix
107
126
  );
127
+
108
128
  this._createBatchIds(tileContent, featureAttributes);
109
129
  if (attributes.normals && !this._checkNormals(attributes.normals.value)) {
110
130
  delete attributes.normals;
@@ -117,16 +137,132 @@ export default class B3dmConverter {
117
137
  material: materialIndex,
118
138
  mode: 4
119
139
  });
140
+ if (this.tileType === TILE3D_TYPE.GLTF) {
141
+ this._createMetadataExtensions(
142
+ gltfBuilder,
143
+ meshIndex,
144
+ featureAttributes,
145
+ attributeStorageInfo,
146
+ tileContent
147
+ );
148
+ }
120
149
  const transformMatrix = this._generateTransformMatrix(cartesianOrigin);
121
150
  const nodeIndex = gltfBuilder.addNode({meshIndex, matrix: transformMatrix});
122
151
  const sceneIndex = gltfBuilder.addScene({nodeIndices: [nodeIndex]});
123
152
  gltfBuilder.setDefaultScene(sceneIndex);
124
153
 
125
154
  gltfBuilder.createBinaryChunk();
155
+ return encodeSync(gltfBuilder.gltf, GLTFWriter, {gltfBuilder});
156
+ }
126
157
 
127
- const gltfBuffer = encodeSync(gltfBuilder.gltf, GLTFWriter);
158
+ private _createMetadataExtensions(
159
+ gltfBuilder: GLTFScenegraph,
160
+ meshIndex: number,
161
+ featureAttributes: I3STileAttributes | null,
162
+ attributeStorageInfo: AttributeStorageInfo[] | null | undefined,
163
+ tileContent: I3STileContent
164
+ ) {
165
+ const propertyAttributes = this._createPropertyAttibutes(
166
+ featureAttributes,
167
+ attributeStorageInfo
168
+ );
169
+ const tableIndex = createExtStructuralMetadata(gltfBuilder, propertyAttributes);
128
170
 
129
- return gltfBuffer;
171
+ const mesh = gltfBuilder.getMesh(meshIndex);
172
+ for (const primitive of mesh.primitives) {
173
+ if (tileContent.attributes._BATCHID?.value) {
174
+ createExtMeshFeatures(
175
+ gltfBuilder,
176
+ primitive,
177
+ tileContent.attributes._BATCHID.value,
178
+ tableIndex
179
+ );
180
+ }
181
+ }
182
+ }
183
+
184
+ private _createPropertyAttibutes(
185
+ featureAttributes: I3STileAttributes | null,
186
+ attributeStorageInfo?: AttributeStorageInfo[] | null | undefined
187
+ ): PropertyAttribute[] {
188
+ if (!featureAttributes || !attributeStorageInfo) {
189
+ return [];
190
+ }
191
+ const propertyAttributeArray: PropertyAttribute[] = [];
192
+ for (const attributeName in featureAttributes) {
193
+ const propertyAttribute = this._convertAttributeStorageInfoToPropertyAttribute(
194
+ attributeName,
195
+ attributeStorageInfo,
196
+ featureAttributes
197
+ );
198
+ if (propertyAttribute) {
199
+ propertyAttributeArray.push(propertyAttribute);
200
+ }
201
+ }
202
+ return propertyAttributeArray;
203
+ }
204
+
205
+ // eslint-disable-next-line complexity
206
+ private _convertAttributeStorageInfoToPropertyAttribute(
207
+ attributeName: string,
208
+ attributeStorageInfo: AttributeStorageInfo[],
209
+ featureAttributes: I3STileAttributes
210
+ ): PropertyAttribute | null {
211
+ const attributeValues = featureAttributes[attributeName];
212
+ const info = attributeStorageInfo.find((e) => e.name === attributeName);
213
+ if (!info) {
214
+ return null;
215
+ }
216
+ const attributeMetadata = info.attributeValues;
217
+ if (!attributeMetadata?.valueType) {
218
+ return null;
219
+ }
220
+ let elementType: string;
221
+ let componentType: string | undefined;
222
+ switch (attributeMetadata.valueType.toLowerCase()) {
223
+ case 'oid32':
224
+ elementType = 'SCALAR';
225
+ componentType = 'UINT32';
226
+ break;
227
+ case 'int32':
228
+ elementType = 'SCALAR';
229
+ componentType = 'INT32';
230
+ break;
231
+ case 'uint32':
232
+ elementType = 'SCALAR';
233
+ componentType = 'UINT32';
234
+ break;
235
+ case 'int16':
236
+ elementType = 'SCALAR';
237
+ componentType = 'INT16';
238
+ break;
239
+ case 'uint16':
240
+ elementType = 'SCALAR';
241
+ componentType = 'UINT16';
242
+ break;
243
+ case 'float64':
244
+ elementType = 'SCALAR';
245
+ componentType = 'FLOAT64';
246
+ break;
247
+ case 'string':
248
+ elementType = 'STRING';
249
+ break;
250
+ default:
251
+ elementType = '';
252
+ break;
253
+ }
254
+ const propertyAttribute: PropertyAttribute = {
255
+ name: attributeName,
256
+ elementType,
257
+ componentType,
258
+ values: []
259
+ };
260
+ if (isTypedArray(attributeValues)) {
261
+ propertyAttribute.values = Array.from(attributeValues);
262
+ } else if (attributeValues !== null) {
263
+ propertyAttribute.values = attributeValues;
264
+ }
265
+ return propertyAttribute;
130
266
  }
131
267
 
132
268
  /**
@@ -26,6 +26,9 @@ type TileConversionOptions = {
26
26
  /** Output folder. This folder will be created by converter if doesn't exist. It is relative to the converter path.
27
27
  * Default: "data" folder */
28
28
  output: string;
29
+ /** 3DTile version.
30
+ * Default: version "1.1" */
31
+ outputVersion?: string;
29
32
  /** Keep created 3DNodeIndexDocument files on disk instead of memory. This option reduce memory usage but decelerates conversion speed */
30
33
  instantNodeWriting: boolean;
31
34
  /** Try to merge similar materials to be able to merge meshes into one node (I3S to 3DTiles conversion only) */
@@ -177,6 +180,9 @@ function printHelp(): void {
177
180
  '--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]'
178
181
  );
179
182
  console.log('--input-type [tileset input type: I3S or 3DTILES]');
183
+ console.log(
184
+ '--output-version [3dtile version: 1.0 or 1.1, default: 1.1]. This option supports only 1.0/1.1 values for 3DTiles output. I3S output version setting is not supported yet.'
185
+ );
180
186
  console.log(
181
187
  '--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format or "None" to not use it. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'
182
188
  );
@@ -212,6 +218,7 @@ async function convert(options: ValidatedTileConversionOptions) {
212
218
  await tiles3DConverter.convert({
213
219
  inputUrl: options.tileset,
214
220
  outputPath: options.output,
221
+ outputVersion: options.outputVersion,
215
222
  tilesetName: options.name,
216
223
  maxDepth: options.maxDepth,
217
224
  egmFilePath: options.egm,
@@ -272,6 +279,17 @@ function validateOptions(
272
279
  console.log('Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]'),
273
280
  condition: (value) =>
274
281
  addHash || (Boolean(value) && Object.values(TILESET_TYPE).includes(value.toUpperCase()))
282
+ },
283
+ outputVersion: {
284
+ getMessage: () =>
285
+ console.log('Incorrect: --output-version [1.0 or 1.1] is for --input-type "I3S" only'),
286
+ condition: (value) =>
287
+ addHash ||
288
+ (Boolean(value) &&
289
+ Object.values(['1.0', '1.1']).includes(value) &&
290
+ Boolean(options.inputType === 'I3S')) ||
291
+ Boolean(options.inputType !== 'I3S') ||
292
+ Boolean(options.analyze)
275
293
  }
276
294
  };
277
295
  const exceptions: (() => void)[] = [];
@@ -300,6 +318,7 @@ function validateOptions(
300
318
  function parseOptions(args: string[]): TileConversionOptions {
301
319
  const opts: TileConversionOptions = {
302
320
  output: 'data',
321
+ outputVersion: '1.1',
303
322
  instantNodeWriting: false,
304
323
  mergeMaterials: true,
305
324
  egm: join(process.cwd(), 'deps', 'egm2008-5.pgm'),
@@ -328,6 +347,9 @@ function parseOptions(args: string[]): TileConversionOptions {
328
347
  case '--output':
329
348
  opts.output = getStringValue(index, args);
330
349
  break;
350
+ case '--output-version':
351
+ opts.outputVersion = getStringValue(index, args);
352
+ break;
331
353
  case '--instant-node-writing':
332
354
  opts.instantNodeWriting = getBooleanValue(index, args);
333
355
  break;
@@ -1,19 +1,19 @@
1
1
  /* eslint-disable camelcase */
2
- import {GLTFAccessorPostprocessed, GLTFMeshPrimitivePostprocessed} from '@loaders.gl/gltf';
3
2
  import type {NumericArray} from '@loaders.gl/loader-utils';
4
3
  import type {
4
+ GLTFAccessorPostprocessed,
5
+ GLTFMeshPrimitivePostprocessed,
5
6
  GLTF_EXT_feature_metadata_FeatureIdTexture,
6
7
  GLTF_EXT_feature_metadata_GLTF,
7
- GLTF_EXT_feature_metadata_Primitive
8
+ GLTF_EXT_feature_metadata_Primitive,
9
+ GLTF_EXT_mesh_features
8
10
  } from '@loaders.gl/gltf';
9
-
10
- import type {GLTF_EXT_mesh_features} from '@loaders.gl/gltf';
11
+ import {EXT_MESH_FEATURES, EXT_FEATURE_METADATA} from '@loaders.gl/gltf';
12
+ import {Tiles3DTileContent} from '@loaders.gl/3d-tiles';
11
13
 
12
14
  import {TypedArray} from '@math.gl/core';
13
15
  import {TextureImageProperties} from '../types';
14
16
  import {emod} from '@loaders.gl/math';
15
- import {EXT_MESH_FEATURES, EXT_FEATURE_METADATA} from '@loaders.gl/gltf';
16
- import {Tiles3DTileContent} from '@loaders.gl/3d-tiles';
17
17
 
18
18
  /**
19
19
  * Get featureTexture by a metadata class.
@@ -20,7 +20,12 @@ import {Ellipsoid} from '@math.gl/geospatial';
20
20
 
21
21
  import {DracoWriterWorker} from '@loaders.gl/draco';
22
22
  import {assert, encode} from '@loaders.gl/core';
23
- import {concatenateArrayBuffers, concatenateTypedArrays} from '@loaders.gl/loader-utils';
23
+ import {
24
+ concatenateArrayBuffers,
25
+ concatenateTypedArrays,
26
+ NumberArray,
27
+ TypedArray
28
+ } from '@loaders.gl/loader-utils';
24
29
  import md5 from 'md5';
25
30
  import {v4 as uuidv4} from 'uuid';
26
31
  import {generateAttributes} from './geometry-attributes';
@@ -38,7 +43,6 @@ import {
38
43
  MaterialDefinitionInfo,
39
44
  TextureDefinitionInfo
40
45
  } from '@loaders.gl/i3s';
41
- import {NumberArray, TypedArray} from '@loaders.gl/loader-utils';
42
46
  import {Geoid} from '@math.gl/geoid';
43
47
  import {prepareDataForAttributesConversion} from './gltf-attributes';
44
48
  import {getTextureByMetadataClass, handleBatchIdsExtensions} from './batch-ids-extensions';
@@ -6,10 +6,10 @@ import {
6
6
  GLTF,
7
7
  GLTFLoader,
8
8
  GLTF_EXT_feature_metadata_GLTF,
9
- GLTF_EXT_structural_metadata_GLTF
9
+ GLTF_EXT_structural_metadata_GLTF,
10
+ EXT_FEATURE_METADATA
10
11
  } from '@loaders.gl/gltf';
11
12
  import {parse} from '@loaders.gl/core';
12
- import {EXT_FEATURE_METADATA} from '@loaders.gl/gltf';
13
13
 
14
14
  /**
15
15
  * glTF primitive modes
@@ -82,6 +82,7 @@ import {composeHashFile, createZip} from '@loaders.gl/zip';
82
82
  import {ConversionDump, ConversionDumpOptions, DumpMetadata} from '../lib/utils/conversion-dump';
83
83
  import {PromptModule} from 'inquirer';
84
84
 
85
+ // eslint-disable-next-line no-process-env
85
86
  const ION_DEFAULT_TOKEN = process.env?.IonToken;
86
87
  const HARDCODED_NODES_PER_PAGE = 64;
87
88
  const _3D_TILES = '3DTILES';
@@ -23,6 +23,7 @@ Example for path `./data/BatchTextured/SceneServer/layers/0/...`:
23
23
  ```bash
24
24
  PORT=8080 HTTPS_PORT=4443 I3sLayerPath="./data" DEBUG=i3s-server:* npx i3s-server
25
25
  ```
26
+
26
27
  #### Check the layer availability
27
28
 
28
29
  The layer should be available on URLs:
@@ -47,6 +48,7 @@ Example for path `../datasets/Rancho_Mesh_mesh_v17_1.slpk`:
47
48
  ```bash
48
49
  PORT=8080 HTTPS_PORT=4443 I3sLayerPath="../datasets/Rancho_Mesh_mesh_v17_1.slpk" DEBUG=i3s-server:* npx i3s-server
49
50
  ```
51
+
50
52
  #### Check the layer availability
51
53
 
52
54
  The layer should be available on URLs:
@@ -14,12 +14,14 @@ import {formErrorHandler, formListeningHandler, normalizePort} from '../utils/se
14
14
  // const __dirname = path.dirname(__filename);
15
15
 
16
16
  /** Get port from environment and store in Express. */
17
+ // eslint-disable-next-line no-process-env
17
18
  const httpPort = normalizePort(process.env.PORT || '80');
18
19
  if (httpPort === false) {
19
20
  // eslint-disable-next-line no-console
20
21
  console.error('Incorrect HTTP port');
21
22
  process.exit(1); // eslint-disable-line no-process-exit
22
23
  }
24
+ // eslint-disable-next-line no-process-env
23
25
  const httpsPort = normalizePort(process.env.HTTPS_PORT || '443');
24
26
  if (httpsPort === false) {
25
27
  // eslint-disable-next-line no-console