@loaders.gl/tile-converter 3.2.10 → 3.2.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/3d-tiles-attributes-worker.js +1 -1
- package/dist/converter-cli.js +15 -2
- package/dist/converter.min.js +1 -1
- package/dist/dist.min.js +16 -14
- package/dist/es5/3d-tiles-attributes-worker.js +1 -1
- package/dist/es5/converter-cli.js +9 -2
- package/dist/es5/converter-cli.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +1 -1
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js +6 -6
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +28 -23
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +1 -1
- package/dist/esm/converter-cli.js +9 -2
- package/dist/esm/converter-cli.js.map +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js +6 -6
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +13 -7
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/coordinate-converter.js +8 -6
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +9 -7
- package/package.json +15 -15
- package/src/converter-cli.ts +16 -2
- package/src/i3s-converter/helpers/coordinate-converter.ts +8 -6
- package/src/i3s-converter/i3s-converter.ts +17 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"AAEA,OAAO,KAA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;IAO7B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;;;OAGG;IACH,OAAO,CAAC,sCAAsC;IAyB9C;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAe9B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAgCxB;;;OAGG;YACW,iBAAiB;IAqB/B;;OAEG;YACW,oBAAoB;IAYlC;;OAEG;YACW,qBAAqB;IAkBnC;;OAEG;IACH,OAAO,CAAC,8BAA8B;IAUtC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;YAIZ,WAAW;CAsB1B"}
|
|
@@ -118,7 +118,7 @@ class I3SConverter {
|
|
|
118
118
|
const sourceTilesetJson = await (0, core_1.load)(inputUrl, this.Loader, tilesetOptions.loadOptions);
|
|
119
119
|
// console.log(tilesetJson); // eslint-disable-line
|
|
120
120
|
this.sourceTileset = new tiles_1.Tileset3D(sourceTilesetJson, tilesetOptions);
|
|
121
|
-
await this._createAndSaveTileset(outputPath, tilesetName);
|
|
121
|
+
await this._createAndSaveTileset(outputPath, tilesetName, sourceTilesetJson?.root?.boundingVolume?.region);
|
|
122
122
|
await this._finishConversion({ slpk: Boolean(slpk), outputPath, tilesetName });
|
|
123
123
|
return sourceTilesetJson;
|
|
124
124
|
}
|
|
@@ -136,7 +136,7 @@ class I3SConverter {
|
|
|
136
136
|
* @param outputPath - path to save output data
|
|
137
137
|
* @param tilesetName - new tileset path
|
|
138
138
|
*/
|
|
139
|
-
async _createAndSaveTileset(outputPath, tilesetName) {
|
|
139
|
+
async _createAndSaveTileset(outputPath, tilesetName, boundingVolumeRegion) {
|
|
140
140
|
const tilesetPath = (0, path_1.join)(`${outputPath}`, `${tilesetName}`);
|
|
141
141
|
// Removing the tilesetPath needed to exclude erroneous files after conversion
|
|
142
142
|
try {
|
|
@@ -146,7 +146,7 @@ class I3SConverter {
|
|
|
146
146
|
// do nothing
|
|
147
147
|
}
|
|
148
148
|
this.layers0Path = (0, path_1.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
149
|
-
this._formLayers0(tilesetName);
|
|
149
|
+
this._formLayers0(tilesetName, boundingVolumeRegion);
|
|
150
150
|
this.materialDefinitions = [];
|
|
151
151
|
this.materialMap = new Map();
|
|
152
152
|
const sourceRootTile = this.sourceTileset.root;
|
|
@@ -176,8 +176,12 @@ class I3SConverter {
|
|
|
176
176
|
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
177
177
|
* @param tilesetName - Name of layer
|
|
178
178
|
*/
|
|
179
|
-
_formLayers0(tilesetName) {
|
|
179
|
+
_formLayers0(tilesetName, boundingVolumeRegion) {
|
|
180
180
|
const fullExtent = (0, coordinate_converter_1.convertBoundingVolumeToI3SFullExtent)(this.sourceTileset?.boundingVolume || this.sourceTileset?.root?.boundingVolume);
|
|
181
|
+
if (boundingVolumeRegion) {
|
|
182
|
+
fullExtent.zmin = boundingVolumeRegion[4];
|
|
183
|
+
fullExtent.zmax = boundingVolumeRegion[5];
|
|
184
|
+
}
|
|
181
185
|
const extent = [fullExtent.xmin, fullExtent.ymin, fullExtent.xmax, fullExtent.ymax];
|
|
182
186
|
const layers0data = {
|
|
183
187
|
version: `{${(0, uuid_1.v4)().toUpperCase()}}`,
|
|
@@ -420,9 +424,7 @@ class I3SConverter {
|
|
|
420
424
|
* @param level - level of node (distanse to root node in the tree)
|
|
421
425
|
*/
|
|
422
426
|
async _createNode(parentTile, sourceTile, parentId, level) {
|
|
423
|
-
|
|
424
|
-
this._checkAddRefinementTypeForTile(sourceTile);
|
|
425
|
-
}
|
|
427
|
+
this._checkAddRefinementTypeForTile(sourceTile);
|
|
426
428
|
await this._updateTilesetOptions();
|
|
427
429
|
await this.sourceTileset._loadTile(sourceTile);
|
|
428
430
|
let boundingVolumes = (0, coordinate_converter_1.createBoundingVolumes)(sourceTile, this.geoidHeightModel);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tile-converter",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.12",
|
|
4
4
|
"description": "Converter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"build-3d-tiles-attributes-worker": "esbuild src/workers/3d-tiles-attributes-worker.ts --outfile=dist/3d-tiles-attributes-worker.js --platform=node --target=esnext,node12 --minify --bundle --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@loaders.gl/3d-tiles": "3.2.
|
|
47
|
-
"@loaders.gl/crypto": "3.2.
|
|
48
|
-
"@loaders.gl/draco": "3.2.
|
|
49
|
-
"@loaders.gl/gltf": "3.2.
|
|
50
|
-
"@loaders.gl/i3s": "3.2.
|
|
51
|
-
"@loaders.gl/images": "3.2.
|
|
52
|
-
"@loaders.gl/loader-utils": "3.2.
|
|
53
|
-
"@loaders.gl/polyfills": "3.2.
|
|
54
|
-
"@loaders.gl/schema": "3.2.
|
|
55
|
-
"@loaders.gl/textures": "3.2.
|
|
56
|
-
"@loaders.gl/tiles": "3.2.
|
|
57
|
-
"@loaders.gl/worker-utils": "3.2.
|
|
58
|
-
"@loaders.gl/zip": "3.2.
|
|
46
|
+
"@loaders.gl/3d-tiles": "3.2.12",
|
|
47
|
+
"@loaders.gl/crypto": "3.2.12",
|
|
48
|
+
"@loaders.gl/draco": "3.2.12",
|
|
49
|
+
"@loaders.gl/gltf": "3.2.12",
|
|
50
|
+
"@loaders.gl/i3s": "3.2.12",
|
|
51
|
+
"@loaders.gl/images": "3.2.12",
|
|
52
|
+
"@loaders.gl/loader-utils": "3.2.12",
|
|
53
|
+
"@loaders.gl/polyfills": "3.2.12",
|
|
54
|
+
"@loaders.gl/schema": "3.2.12",
|
|
55
|
+
"@loaders.gl/textures": "3.2.12",
|
|
56
|
+
"@loaders.gl/tiles": "3.2.12",
|
|
57
|
+
"@loaders.gl/worker-utils": "3.2.12",
|
|
58
|
+
"@loaders.gl/zip": "3.2.12",
|
|
59
59
|
"@luma.gl/engine": "^8.5.4",
|
|
60
60
|
"@math.gl/core": "^3.5.1",
|
|
61
61
|
"@math.gl/culling": "^3.5.1",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@loaders.gl/core": "^3.2.0"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "7d46e4ff10047e479374e9b3411f5142a79df15f"
|
|
79
79
|
}
|
package/src/converter-cli.ts
CHANGED
|
@@ -194,7 +194,7 @@ function validateOptions(options: TileConversionOptions): ValidatedTileConversio
|
|
|
194
194
|
}
|
|
195
195
|
if (exceptions.length) {
|
|
196
196
|
exceptions.forEach((exeption) => exeption());
|
|
197
|
-
process.exit(
|
|
197
|
+
process.exit(1);
|
|
198
198
|
}
|
|
199
199
|
return <ValidatedTileConversionOptions>options;
|
|
200
200
|
}
|
|
@@ -225,7 +225,7 @@ function parseOptions(args: string[]): TileConversionOptions {
|
|
|
225
225
|
opts.inputType = getStringValue(index, args);
|
|
226
226
|
break;
|
|
227
227
|
case '--tileset':
|
|
228
|
-
opts.tileset =
|
|
228
|
+
opts.tileset = getURLValue(index, args);
|
|
229
229
|
break;
|
|
230
230
|
case '--name':
|
|
231
231
|
opts.name = getStringValue(index, args);
|
|
@@ -293,6 +293,20 @@ function getStringValue(index: number, args: string[]): string {
|
|
|
293
293
|
return value;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Modyfy URL path to be compatible with fetch
|
|
298
|
+
* @param index - option's name index in the argument's array.
|
|
299
|
+
* The value of the option should be next to name of the option.
|
|
300
|
+
* @param args - cli arguments array
|
|
301
|
+
* @returns - string value of the option
|
|
302
|
+
*/
|
|
303
|
+
function getURLValue(index: number, args: string[]): string {
|
|
304
|
+
const value = getStringValue(index, args);
|
|
305
|
+
console.log(`Input tileset value: ${value}`);
|
|
306
|
+
console.log(`Modified tileset value: ${value.replace(/\\/g, '/')}`);
|
|
307
|
+
return value.replace(/\\/g, '/');
|
|
308
|
+
}
|
|
309
|
+
|
|
296
310
|
/**
|
|
297
311
|
* Get integer option value from cli arguments
|
|
298
312
|
* @param index - option's name index in the argument's array
|
|
@@ -126,13 +126,15 @@ export function convertBoundingVolumeToI3SFullExtent(
|
|
|
126
126
|
new Vector3()
|
|
127
127
|
);
|
|
128
128
|
|
|
129
|
+
// Converter sometimes returns min values that are bigger then max,
|
|
130
|
+
// so we should check and take bigger value from max and smaller for nim
|
|
129
131
|
return {
|
|
130
|
-
xmin: vertexMin[0],
|
|
131
|
-
xmax: vertexMax[0],
|
|
132
|
-
ymin: vertexMin[1],
|
|
133
|
-
ymax: vertexMax[1],
|
|
134
|
-
zmin: vertexMin[2],
|
|
135
|
-
zmax: vertexMax[2]
|
|
132
|
+
xmin: Math.min(vertexMin[0], vertexMax[0]),
|
|
133
|
+
xmax: Math.max(vertexMin[0], vertexMax[0]),
|
|
134
|
+
ymin: Math.min(vertexMin[1], vertexMax[1]),
|
|
135
|
+
ymax: Math.max(vertexMin[1], vertexMax[1]),
|
|
136
|
+
zmin: Math.min(vertexMin[2], vertexMax[2]),
|
|
137
|
+
zmax: Math.max(vertexMin[2], vertexMax[2])
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
|
|
@@ -199,7 +199,11 @@ export default class I3SConverter {
|
|
|
199
199
|
// console.log(tilesetJson); // eslint-disable-line
|
|
200
200
|
this.sourceTileset = new Tileset3D(sourceTilesetJson, tilesetOptions);
|
|
201
201
|
|
|
202
|
-
await this._createAndSaveTileset(
|
|
202
|
+
await this._createAndSaveTileset(
|
|
203
|
+
outputPath,
|
|
204
|
+
tilesetName,
|
|
205
|
+
sourceTilesetJson?.root?.boundingVolume?.region
|
|
206
|
+
);
|
|
203
207
|
await this._finishConversion({slpk: Boolean(slpk), outputPath, tilesetName});
|
|
204
208
|
return sourceTilesetJson;
|
|
205
209
|
} catch (error) {
|
|
@@ -216,7 +220,11 @@ export default class I3SConverter {
|
|
|
216
220
|
* @param outputPath - path to save output data
|
|
217
221
|
* @param tilesetName - new tileset path
|
|
218
222
|
*/
|
|
219
|
-
private async _createAndSaveTileset(
|
|
223
|
+
private async _createAndSaveTileset(
|
|
224
|
+
outputPath: string,
|
|
225
|
+
tilesetName: string,
|
|
226
|
+
boundingVolumeRegion?: number[]
|
|
227
|
+
): Promise<void> {
|
|
220
228
|
const tilesetPath = join(`${outputPath}`, `${tilesetName}`);
|
|
221
229
|
// Removing the tilesetPath needed to exclude erroneous files after conversion
|
|
222
230
|
try {
|
|
@@ -227,7 +235,7 @@ export default class I3SConverter {
|
|
|
227
235
|
|
|
228
236
|
this.layers0Path = join(tilesetPath, 'SceneServer', 'layers', '0');
|
|
229
237
|
|
|
230
|
-
this._formLayers0(tilesetName);
|
|
238
|
+
this._formLayers0(tilesetName, boundingVolumeRegion);
|
|
231
239
|
|
|
232
240
|
this.materialDefinitions = [];
|
|
233
241
|
this.materialMap = new Map();
|
|
@@ -267,10 +275,14 @@ export default class I3SConverter {
|
|
|
267
275
|
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
268
276
|
* @param tilesetName - Name of layer
|
|
269
277
|
*/
|
|
270
|
-
private _formLayers0(tilesetName: string): void {
|
|
278
|
+
private _formLayers0(tilesetName: string, boundingVolumeRegion?: number[]): void {
|
|
271
279
|
const fullExtent = convertBoundingVolumeToI3SFullExtent(
|
|
272
280
|
this.sourceTileset?.boundingVolume || this.sourceTileset?.root?.boundingVolume
|
|
273
281
|
);
|
|
282
|
+
if (boundingVolumeRegion) {
|
|
283
|
+
fullExtent.zmin = boundingVolumeRegion[4];
|
|
284
|
+
fullExtent.zmax = boundingVolumeRegion[5];
|
|
285
|
+
}
|
|
274
286
|
const extent = [fullExtent.xmin, fullExtent.ymin, fullExtent.xmax, fullExtent.ymax];
|
|
275
287
|
const layers0data = {
|
|
276
288
|
version: `{${uuidv4().toUpperCase()}}`,
|
|
@@ -563,9 +575,7 @@ export default class I3SConverter {
|
|
|
563
575
|
parentId: number,
|
|
564
576
|
level: number
|
|
565
577
|
): Promise<Node3DIndexDocument[]> {
|
|
566
|
-
|
|
567
|
-
this._checkAddRefinementTypeForTile(sourceTile);
|
|
568
|
-
}
|
|
578
|
+
this._checkAddRefinementTypeForTile(sourceTile);
|
|
569
579
|
|
|
570
580
|
await this._updateTilesetOptions();
|
|
571
581
|
await this.sourceTileset!._loadTile(sourceTile);
|