@loaders.gl/tile-converter 4.0.0-alpha.22 → 4.0.0-alpha.23
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/constants.d.ts +0 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -3
- package/dist/converter.min.js +106 -106
- package/dist/dist.min.js +1744 -1157
- package/dist/es5/constants.js +1 -5
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +26 -11
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/feature-attributes.js +14 -12
- package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +61 -10
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/node-index-document.js +3 -2
- package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +1 -2
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +36 -26
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-server/controllers/slpk-controller.js +2 -2
- package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/es5/slpk-extractor/slpk-extractor.js +1 -1
- package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -1
- package/dist/esm/constants.js +0 -2
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +21 -6
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/feature-attributes.js +6 -4
- package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +59 -8
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/node-index-document.js +2 -1
- package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +1 -1
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +20 -17
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/i3s-server/bin/i3s-server.min.js +71 -71
- package/dist/esm/i3s-server/controllers/slpk-controller.js +1 -1
- package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/esm/slpk-extractor/slpk-extractor.js +2 -1
- package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +37 -16
- package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/feature-attributes.js +6 -4
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +2 -2
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +93 -12
- package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/node-index-document.js +4 -1
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +2 -2
- package/dist/i3s-converter/i3s-converter.d.ts +1 -1
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +32 -13
- package/dist/i3s-server/controllers/slpk-controller.js +2 -2
- package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -1
- package/dist/slpk-extractor/slpk-extractor.js +2 -1
- package/dist/slpk-extractor.min.js +38 -38
- package/package.json +14 -14
- package/src/constants.ts +0 -3
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +53 -14
- package/src/i3s-converter/helpers/feature-attributes.ts +8 -6
- package/src/i3s-converter/helpers/geometry-converter.ts +135 -12
- package/src/i3s-converter/helpers/node-index-document.ts +5 -1
- package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +1 -1
- package/src/i3s-converter/i3s-converter.ts +42 -17
- package/src/i3s-server/controllers/slpk-controller.ts +1 -1
- package/src/slpk-extractor/slpk-extractor.ts +2 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@loaders.gl/polyfills';
|
|
2
2
|
import { parseSLPK } from '@loaders.gl/i3s';
|
|
3
|
-
import { FileHandleFile } from '@loaders.gl/
|
|
3
|
+
import { FileHandleFile } from '@loaders.gl/loader-utils';
|
|
4
4
|
let slpkArchive;
|
|
5
5
|
export const loadArchive = async fullLayerPath => {
|
|
6
6
|
slpkArchive = await parseSLPK(await FileHandleFile.from(fullLayerPath), msg => console.log(msg));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slpk-controller.js","names":["parseSLPK","FileHandleFile","slpkArchive","loadArchive","fullLayerPath","from","msg","console","log","getFileByUrl","url","trimmedPath","exec","uncompressedFile","Buffer","getFile","e"],"sources":["../../../../src/i3s-server/controllers/slpk-controller.ts"],"sourcesContent":["import '@loaders.gl/polyfills';\nimport {parseSLPK} from '@loaders.gl/i3s';\nimport {FileHandleFile} from '@loaders.gl/
|
|
1
|
+
{"version":3,"file":"slpk-controller.js","names":["parseSLPK","FileHandleFile","slpkArchive","loadArchive","fullLayerPath","from","msg","console","log","getFileByUrl","url","trimmedPath","exec","uncompressedFile","Buffer","getFile","e"],"sources":["../../../../src/i3s-server/controllers/slpk-controller.ts"],"sourcesContent":["import '@loaders.gl/polyfills';\nimport {parseSLPK} from '@loaders.gl/i3s';\nimport {FileHandleFile} from '@loaders.gl/loader-utils';\n\nlet slpkArchive;\n\n/**\n * Open SLPK file for reading and load HASH file\n * @param fullLayerPath - full path to SLPK file\n */\nexport const loadArchive = async (fullLayerPath: string): Promise<void> => {\n slpkArchive = await parseSLPK(await FileHandleFile.from(fullLayerPath), (msg) =>\n console.log(msg)\n );\n console.log('The server is ready to use');\n};\n\n/**\n * Get a file from SLPK\n * @param url - I3S HTTP URL\n * @returns - file content\n */\nexport async function getFileByUrl(url: string) {\n const trimmedPath = /^\\/?(.*)\\/?$/.exec(url);\n let uncompressedFile: Buffer | null = null;\n if (trimmedPath) {\n try {\n uncompressedFile = Buffer.from(await slpkArchive.getFile(trimmedPath[1], 'http'));\n } catch (e) {}\n }\n return uncompressedFile;\n}\n"],"mappings":"AAAA,OAAO,uBAAuB;AAC9B,SAAQA,SAAS,QAAO,iBAAiB;AACzC,SAAQC,cAAc,QAAO,0BAA0B;AAEvD,IAAIC,WAAW;AAMf,OAAO,MAAMC,WAAW,GAAG,MAAOC,aAAqB,IAAoB;EACzEF,WAAW,GAAG,MAAMF,SAAS,CAAC,MAAMC,cAAc,CAACI,IAAI,CAACD,aAAa,CAAC,EAAGE,GAAG,IAC1EC,OAAO,CAACC,GAAG,CAACF,GAAG,CACjB,CAAC;EACDC,OAAO,CAACC,GAAG,CAAC,4BAA4B,CAAC;AAC3C,CAAC;AAOD,OAAO,eAAeC,YAAYA,CAACC,GAAW,EAAE;EAC9C,MAAMC,WAAW,GAAG,cAAc,CAACC,IAAI,CAACF,GAAG,CAAC;EAC5C,IAAIG,gBAA+B,GAAG,IAAI;EAC1C,IAAIF,WAAW,EAAE;IACf,IAAI;MACFE,gBAAgB,GAAGC,MAAM,CAACT,IAAI,CAAC,MAAMH,WAAW,CAACa,OAAO,CAACJ,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACnF,CAAC,CAAC,OAAOK,CAAC,EAAE,CAAC;EACf;EACA,OAAOH,gBAAgB;AACzB"}
|
package/dist/esm/pgm-loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parsePGM } from '@math.gl/geoid';
|
|
2
|
-
const VERSION = typeof "4.0.0-alpha.
|
|
2
|
+
const VERSION = typeof "4.0.0-alpha.23" !== 'undefined' ? "4.0.0-alpha.23" : 'latest';
|
|
3
3
|
export const PGMLoader = {
|
|
4
4
|
name: 'PGM - Netpbm grayscale image format',
|
|
5
5
|
id: 'pgm',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isBrowser } from '@loaders.gl/core';
|
|
2
2
|
import { BROWSER_ERROR_MESSAGE } from '../constants';
|
|
3
3
|
import { path } from '@loaders.gl/loader-utils';
|
|
4
|
-
import { FileHandleFile
|
|
4
|
+
import { FileHandleFile } from '@loaders.gl/loader-utils';
|
|
5
|
+
import { parseZipLocalFileHeader } from '@loaders.gl/zip';
|
|
5
6
|
import { GZipCompression } from '@loaders.gl/compression';
|
|
6
7
|
import { writeFile } from '../lib/utils/file-utils';
|
|
7
8
|
const indexNames = ['3dSceneLayer.json.gz', '3dNodeIndexDocument.json.gz', 'sharedResource.json.gz'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slpk-extractor.js","names":["isBrowser","BROWSER_ERROR_MESSAGE","path","FileHandleFile","parseZipLocalFileHeader","GZipCompression","writeFile","indexNames","SLPKExtractor","extract","options","console","log","inputUrl","provider","from","localHeader","_localHeader","unGzip","name","correctIndexNames","fileName","data","slice","fileDataOffset","compressedSize","outputPath","includes","filename","join","dirname","parts","exec","concat","at","file","_file$name","test","_file$name2","compression","decompressedData","decompress","Promise","resolve","finalPath","dirName"],"sources":["../../../src/slpk-extractor/slpk-extractor.ts"],"sourcesContent":["import {isBrowser} from '@loaders.gl/core';\n\nimport {BROWSER_ERROR_MESSAGE} from '../constants';\nimport {path} from '@loaders.gl/loader-utils';\nimport {FileHandleFile
|
|
1
|
+
{"version":3,"file":"slpk-extractor.js","names":["isBrowser","BROWSER_ERROR_MESSAGE","path","FileHandleFile","parseZipLocalFileHeader","GZipCompression","writeFile","indexNames","SLPKExtractor","extract","options","console","log","inputUrl","provider","from","localHeader","_localHeader","unGzip","name","correctIndexNames","fileName","data","slice","fileDataOffset","compressedSize","outputPath","includes","filename","join","dirname","parts","exec","concat","at","file","_file$name","test","_file$name2","compression","decompressedData","decompress","Promise","resolve","finalPath","dirName"],"sources":["../../../src/slpk-extractor/slpk-extractor.ts"],"sourcesContent":["import {isBrowser} from '@loaders.gl/core';\n\nimport {BROWSER_ERROR_MESSAGE} from '../constants';\nimport {path} from '@loaders.gl/loader-utils';\nimport {FileHandleFile} from '@loaders.gl/loader-utils';\nimport {parseZipLocalFileHeader} from '@loaders.gl/zip';\nimport {GZipCompression} from '@loaders.gl/compression';\nimport {writeFile} from '../lib/utils/file-utils';\n\nconst indexNames = [\n '3dSceneLayer.json.gz',\n '3dNodeIndexDocument.json.gz',\n 'sharedResource.json.gz'\n];\n\n/**\n * Description of the file in the SLPK\n */\ntype File = {\n name: string | null;\n data: ArrayBuffer;\n};\n\n/**\n * Converter from slpk to i3s\n */\nexport default class SLPKExtractor {\n /**\n * Extract slpk to i3s\n * @param options\n * @param options.inputUrl the url to read SLPK file\n * @param options.outputPath the output filename\n */\n public async extract(options: {inputUrl: string; outputPath: string}): Promise<string> {\n if (isBrowser) {\n console.log(BROWSER_ERROR_MESSAGE);\n return BROWSER_ERROR_MESSAGE;\n }\n const {inputUrl} = options;\n\n const provider = await FileHandleFile.from(inputUrl);\n\n let localHeader = await parseZipLocalFileHeader(0n, provider);\n while (localHeader) {\n await this.writeFile(\n await this.unGzip({\n name: this.correctIndexNames(localHeader.fileName),\n data: await provider.slice(\n localHeader.fileDataOffset,\n localHeader.fileDataOffset + localHeader.compressedSize\n )\n }),\n options.outputPath\n );\n localHeader = await parseZipLocalFileHeader(\n localHeader.fileDataOffset + localHeader?.compressedSize,\n provider\n );\n }\n\n return 'success';\n }\n\n /**\n * Defines file name and path for i3s format\n * @param fileName initial file name and path\n */\n\n private correctIndexNames(fileName: string): string | null {\n if (indexNames.includes(path.filename(path.join('/', fileName)))) {\n return path.join(path.dirname(fileName), 'index.json.gz');\n }\n // finds path with name part and extention part\n let parts = /^(.*\\/[^\\/\\.]*)(\\..+)$/.exec(fileName);\n if (!parts) {\n return null;\n }\n return `${parts?.at(1)}/index${parts?.at(2)}`;\n }\n\n private async unGzip(file: File): Promise<File> {\n if (/\\.gz$/.test(file.name ?? '')) {\n const compression = new GZipCompression();\n\n const decompressedData = await compression.decompress(file.data);\n\n return {data: decompressedData, name: (file.name ?? '').slice(0, -3)};\n }\n return Promise.resolve(file);\n }\n\n private async writeFile(options: File, outputPath: string): Promise<void> {\n if (!options.name) {\n return;\n }\n const finalPath = path.join(outputPath, options.name);\n const dirName = path.dirname(finalPath);\n const fileName = path.filename(finalPath);\n await writeFile(dirName, options.data, fileName);\n }\n}\n"],"mappings":"AAAA,SAAQA,SAAS,QAAO,kBAAkB;AAE1C,SAAQC,qBAAqB,QAAO,cAAc;AAClD,SAAQC,IAAI,QAAO,0BAA0B;AAC7C,SAAQC,cAAc,QAAO,0BAA0B;AACvD,SAAQC,uBAAuB,QAAO,iBAAiB;AACvD,SAAQC,eAAe,QAAO,yBAAyB;AACvD,SAAQC,SAAS,QAAO,yBAAyB;AAEjD,MAAMC,UAAU,GAAG,CACjB,sBAAsB,EACtB,6BAA6B,EAC7B,wBAAwB,CACzB;AAaD,eAAe,MAAMC,aAAa,CAAC;EAOjC,MAAaC,OAAOA,CAACC,OAA+C,EAAmB;IACrF,IAAIV,SAAS,EAAE;MACbW,OAAO,CAACC,GAAG,CAACX,qBAAqB,CAAC;MAClC,OAAOA,qBAAqB;IAC9B;IACA,MAAM;MAACY;IAAQ,CAAC,GAAGH,OAAO;IAE1B,MAAMI,QAAQ,GAAG,MAAMX,cAAc,CAACY,IAAI,CAACF,QAAQ,CAAC;IAEpD,IAAIG,WAAW,GAAG,MAAMZ,uBAAuB,CAAC,EAAE,EAAEU,QAAQ,CAAC;I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ChB,IAAI,cAAAiB,UAAA,cAAAA,UAAA,GAAI,EAAE,CAAC,EAAE;MAAA,IAAAE,WAAA;MACjC,MAAMC,WAAW,GAAG,IAAIlC,eAAe,CAAC,CAAC;MAEzC,MAAMmC,gBAAgB,GAAG,MAAMD,WAAW,CAACE,UAAU,CAACN,IAAI,CAACb,IAAI,CAAC;MAEhE,OAAO;QAACA,IAAI,EAAEkB,gBAAgB;QAAErB,IAAI,EAAE,EAAAmB,WAAA,GAACH,IAAI,CAAChB,IAAI,cAAAmB,WAAA,cAAAA,WAAA,GAAI,EAAE,EAAEf,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;MAAC,CAAC;IACvE;IACA,OAAOmB,OAAO,CAACC,OAAO,CAACR,IAAI,CAAC;EAC9B;EAEA,MAAc7B,SAASA,CAACI,OAAa,EAAEgB,UAAkB,EAAiB;IACxE,IAAI,CAAChB,OAAO,CAACS,IAAI,EAAE;MACjB;IACF;IACA,MAAMyB,SAAS,GAAG1C,IAAI,CAAC2B,IAAI,CAACH,UAAU,EAAEhB,OAAO,CAACS,IAAI,CAAC;IACrD,MAAM0B,OAAO,GAAG3C,IAAI,CAAC4B,OAAO,CAACc,SAAS,CAAC;IACvC,MAAMvB,QAAQ,GAAGnB,IAAI,CAAC0B,QAAQ,CAACgB,SAAS,CAAC;IACzC,MAAMtC,SAAS,CAACuC,OAAO,EAAEnC,OAAO,CAACY,IAAI,EAAED,QAAQ,CAAC;EAClD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-ids-extensions.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/batch-ids-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAE,8BAA8B,EAAC,MAAM,kBAAkB,CAAC;AAC3F,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"batch-ids-extensions.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/batch-ids-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAE,8BAA8B,EAAC,MAAM,kBAAkB,CAAC;AAC3F,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAW3D,OAAO,EAAC,sBAAsB,EAAC,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,kBAAkB,EAC/B,aAAa,CAAC,EAAE,MAAM,GACrB,MAAM,GAAG,IAAI,CAcf;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE;IACV,CAAC,GAAG,EAAE,MAAM,GAAG,yBAAyB,CAAC;CAC1C,EACD,SAAS,EAAE,8BAA8B,EACzC,MAAM,EAAE,CAAC,sBAAsB,GAAG,IAAI,CAAC,EAAE,EACzC,cAAc,EAAE,MAAM,GAAG,IAAI,GAC5B,YAAY,CA6Bd"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleBatchIdsExtensions = exports.getTextureByMetadataClass = void 0;
|
|
4
|
-
const
|
|
4
|
+
const math_1 = require("@loaders.gl/math");
|
|
5
|
+
const gltf_1 = require("@loaders.gl/gltf");
|
|
5
6
|
/**
|
|
6
7
|
* Get featureTexture by metadataClass
|
|
7
8
|
* @param tileContent - 3d tile content
|
|
@@ -9,7 +10,7 @@ const constants_1 = require("../../constants");
|
|
|
9
10
|
* @returns featureTexture key
|
|
10
11
|
*/
|
|
11
12
|
function getTextureByMetadataClass(tileContent, metadataClass) {
|
|
12
|
-
const extFeatureMetadata = tileContent.gltf?.extensions?.[
|
|
13
|
+
const extFeatureMetadata = tileContent.gltf?.extensions?.[gltf_1.EXT_FEATURE_METADATA];
|
|
13
14
|
if (!extFeatureMetadata?.featureTextures) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
@@ -37,11 +38,12 @@ function handleBatchIdsExtensions(attributes, primitive, images, featureTexture)
|
|
|
37
38
|
}
|
|
38
39
|
for (const [extensionName, extensionData] of Object.entries(extensions || {})) {
|
|
39
40
|
switch (extensionName) {
|
|
40
|
-
case
|
|
41
|
+
case gltf_1.EXT_FEATURE_METADATA:
|
|
41
42
|
return handleExtFeatureMetadataExtension(attributes, extensionData, images, featureTexture);
|
|
42
|
-
case
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
case gltf_1.EXT_MESH_FEATURES:
|
|
44
|
+
return handleExtMeshFeaturesExtension(attributes, extensionData);
|
|
45
|
+
case gltf_1.EXT_STRUCTURAL_METADATA:
|
|
46
|
+
return handleExtStructuralMetadataExtension(attributes, extensionData);
|
|
45
47
|
default:
|
|
46
48
|
return [];
|
|
47
49
|
}
|
|
@@ -49,6 +51,33 @@ function handleBatchIdsExtensions(attributes, primitive, images, featureTexture)
|
|
|
49
51
|
return [];
|
|
50
52
|
}
|
|
51
53
|
exports.handleBatchIdsExtensions = handleBatchIdsExtensions;
|
|
54
|
+
function handleExtStructuralMetadataExtension(attributes, extStructuralMetadata) {
|
|
55
|
+
// Take only first extension object to get batchIds attribute name.
|
|
56
|
+
const dataAttributeNames = extStructuralMetadata?.dataAttributeNames;
|
|
57
|
+
if (dataAttributeNames?.length) {
|
|
58
|
+
// Let's use the first element of the array
|
|
59
|
+
// TODO: What to do with others if any?
|
|
60
|
+
const batchIdsAttribute = attributes[dataAttributeNames[0]];
|
|
61
|
+
return batchIdsAttribute.value;
|
|
62
|
+
}
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Getting batchIds from EXT_mesh_features extensions.
|
|
67
|
+
* @param attributes - gltf accessors
|
|
68
|
+
* @param extMeshFeatures - EXT_mesh_features extension
|
|
69
|
+
* @returns an array of attribute values
|
|
70
|
+
*/
|
|
71
|
+
function handleExtMeshFeaturesExtension(attributes, extMeshFeatures) {
|
|
72
|
+
const dataAttributeNames = extMeshFeatures?.dataAttributeNames;
|
|
73
|
+
if (dataAttributeNames?.length) {
|
|
74
|
+
// Let's use the first element of the array
|
|
75
|
+
// TODO: What to do with others if any?
|
|
76
|
+
const batchIdsAttribute = attributes[dataAttributeNames[0]];
|
|
77
|
+
return batchIdsAttribute.value;
|
|
78
|
+
}
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
52
81
|
/**
|
|
53
82
|
* Get batchIds from EXT_feature_metadata extension.
|
|
54
83
|
* Docs - https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_feature_metadata
|
|
@@ -136,8 +165,8 @@ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, image
|
|
|
136
165
|
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
137
166
|
const u = textureCoordinates[index];
|
|
138
167
|
const v = textureCoordinates[index + 1];
|
|
139
|
-
const tx = Math.min((emod(u) * image.width) | 0, image.width - 1);
|
|
140
|
-
const ty = Math.min((emod(v) * image.height) | 0, image.height - 1);
|
|
168
|
+
const tx = Math.min(((0, math_1.emod)(u) * image.width) | 0, image.width - 1);
|
|
169
|
+
const ty = Math.min(((0, math_1.emod)(v) * image.height) | 0, image.height - 1);
|
|
141
170
|
const offset = (ty * image.width + tx) * image.components + channels;
|
|
142
171
|
const batchId = new Uint8Array(image.data)[offset];
|
|
143
172
|
batchIds.push(batchId);
|
|
@@ -148,11 +177,3 @@ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, image
|
|
|
148
177
|
}
|
|
149
178
|
return batchIds;
|
|
150
179
|
}
|
|
151
|
-
/**
|
|
152
|
-
* Handle UVs if they are out of range [0,1].
|
|
153
|
-
* @param n
|
|
154
|
-
* @param m
|
|
155
|
-
*/
|
|
156
|
-
function emod(n) {
|
|
157
|
-
return ((n % 1) + 1) % 1;
|
|
158
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-attributes.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/feature-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,KAAK,EAEL,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;GAYG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,MAAM,EAAE,EACpB,aAAa,EAAE,gBAAgB,GAC9B,gBAAgB,CAQlB;
|
|
1
|
+
{"version":3,"file":"feature-attributes.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/feature-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,SAAS,EACT,KAAK,EAEL,SAAS,EACV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;;;;GAYG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,MAAM,EAAE,EACpB,aAAa,EAAE,gBAAgB,GAC9B,gBAAgB,CAQlB;AAoBD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAAE,EACpB,aAAa,EAAE,gBAAgB,GAC9B,OAAO,CAUT;AAUD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAUvE;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,SAAS,GACvB,oBAAoB,CA0BtB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,CAazE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,GAAG,KAAK,CAMtF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,aAAa,EAAE,gBAAgB,GAAG,SAAS,CA8B1E"}
|
|
@@ -30,9 +30,11 @@ exports.flattenPropertyTableByFeatureIds = flattenPropertyTableByFeatureIds;
|
|
|
30
30
|
*/
|
|
31
31
|
function getPropertiesByFeatureIds(properties, featureIds) {
|
|
32
32
|
const resultProperties = [];
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
33
|
+
if (properties) {
|
|
34
|
+
for (const featureId of featureIds) {
|
|
35
|
+
const property = properties[featureId] || null;
|
|
36
|
+
resultProperties.push(property);
|
|
37
|
+
}
|
|
36
38
|
}
|
|
37
39
|
return resultProperties;
|
|
38
40
|
}
|
|
@@ -46,7 +48,7 @@ function getPropertiesByFeatureIds(properties, featureIds) {
|
|
|
46
48
|
function checkPropertiesLength(featureIds, propertyTable) {
|
|
47
49
|
let needFlatten = false;
|
|
48
50
|
for (const attribute of Object.values(propertyTable)) {
|
|
49
|
-
if (featureIds.length !== attribute.length) {
|
|
51
|
+
if (!featureIds || !attribute || featureIds.length !== attribute.length) {
|
|
50
52
|
needFlatten = true;
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -39,8 +39,8 @@ export declare function convertAttributes(attributesData: GLTFAttributesData, ma
|
|
|
39
39
|
* Find property table in tile
|
|
40
40
|
* For example it can be batchTable for b3dm files or property table in gLTF extension.
|
|
41
41
|
* @param tileContent - 3DTiles tile content
|
|
42
|
-
* @param metadataClass -
|
|
43
|
-
* @return batch table from b3dm / feature properties from EXT_FEATURE_METADATA
|
|
42
|
+
* @param metadataClass - user selected feature metadata class name
|
|
43
|
+
* @return batch table from b3dm / feature properties from EXT_FEATURE_METADATA, EXT_MESH_FEATURES or EXT_STRUCTURAL_METADATA
|
|
44
44
|
*/
|
|
45
45
|
export declare function getPropertyTable(tileContent: Tiles3DTileContent | null, metadataClass?: string): FeatureTableJson | null;
|
|
46
46
|
//# sourceMappingURL=geometry-converter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry-converter.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/geometry-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"geometry-converter.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/geometry-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAa/E,OAAO,EAAU,OAAO,EAAU,MAAM,eAAe,CAAC;AAUxD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EAGvB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,oBAAoB,EAIrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAWrC,OAAO,KAAK,EAAC,kBAAkB,EAAgD,MAAM,UAAU,CAAC;AAEhG,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAyBrE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAA8B,wBAAwB,CACpD,WAAW,EAAE,kBAAkB,EAC/B,aAAa,EAAE,OAAO,EACtB,kBAAkB,EAAE,mBAAmB,GAAG,cAAc,EACxD,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACxC,aAAa,EAAE,gBAAgB,GAAG,IAAI,EACtC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,oBAAoB,EAAE,oBAAoB,EAAE,GAAG,SAAS,EACxD,KAAK,EAAE,OAAO,EACd,uBAAuB,EAAE,OAAO,EAChC,oBAAoB,EAAE,OAAO,EAC7B,gBAAgB,EAAE,KAAK,EACvB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAgEzC;AA6ID;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,cAAc,EAAE,kBAAkB,EAClC,sBAAsB,EAAE,sBAAsB,EAAE,EAChD,qBAAqB,EAAE,OAAO,EAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,GAC5B,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAkD3C;AAisCD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,kBAAkB,GAAG,IAAI,EACtC,aAAa,CAAC,EAAE,MAAM,GACrB,gBAAgB,GAAG,IAAI,CAsCzB"}
|
|
@@ -41,7 +41,7 @@ const batch_ids_extensions_1 = require("./batch-ids-extensions");
|
|
|
41
41
|
const feature_attributes_1 = require("./feature-attributes");
|
|
42
42
|
const math_1 = require("@loaders.gl/math");
|
|
43
43
|
const geometry_utils_1 = require("../../lib/utils/geometry-utils");
|
|
44
|
-
const
|
|
44
|
+
const gltf_1 = require("@loaders.gl/gltf");
|
|
45
45
|
// Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.7/pbrMetallicRoughness.cmn.md
|
|
46
46
|
const DEFAULT_ROUGHNESS_FACTOR = 1;
|
|
47
47
|
const DEFAULT_METALLIC_FACTOR = 1;
|
|
@@ -980,9 +980,11 @@ function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attri
|
|
|
980
980
|
};
|
|
981
981
|
for (const propertyName in propertyTableWithObjectIds) {
|
|
982
982
|
const type = getAttributeType(propertyName, attributeStorageInfo);
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
983
|
+
if (type) {
|
|
984
|
+
const value = propertyTableWithObjectIds[propertyName];
|
|
985
|
+
const attributeBuffer = generateAttributeBuffer(type, value);
|
|
986
|
+
attributeBuffers.push(attributeBuffer);
|
|
987
|
+
}
|
|
986
988
|
}
|
|
987
989
|
return attributeBuffers;
|
|
988
990
|
}
|
|
@@ -1017,6 +1019,14 @@ function generateAttributeBuffer(type, value) {
|
|
|
1017
1019
|
*/
|
|
1018
1020
|
function getAttributeType(key, attributeStorageInfo) {
|
|
1019
1021
|
const attribute = attributeStorageInfo.find((attr) => attr.name === key);
|
|
1022
|
+
if (!attribute) {
|
|
1023
|
+
console.error(`attribute is null, key=${key}, attributeStorageInfo=${JSON.stringify(attributeStorageInfo, null, 2)}`);
|
|
1024
|
+
return '';
|
|
1025
|
+
}
|
|
1026
|
+
if (!attribute.attributeValues) {
|
|
1027
|
+
console.error(`attributeValues is null, attribute=${attribute}`);
|
|
1028
|
+
return '';
|
|
1029
|
+
}
|
|
1020
1030
|
return attribute.attributeValues.valueType;
|
|
1021
1031
|
}
|
|
1022
1032
|
/**
|
|
@@ -1148,25 +1158,31 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
|
|
|
1148
1158
|
* Find property table in tile
|
|
1149
1159
|
* For example it can be batchTable for b3dm files or property table in gLTF extension.
|
|
1150
1160
|
* @param tileContent - 3DTiles tile content
|
|
1151
|
-
* @param metadataClass -
|
|
1152
|
-
* @return batch table from b3dm / feature properties from EXT_FEATURE_METADATA
|
|
1161
|
+
* @param metadataClass - user selected feature metadata class name
|
|
1162
|
+
* @return batch table from b3dm / feature properties from EXT_FEATURE_METADATA, EXT_MESH_FEATURES or EXT_STRUCTURAL_METADATA
|
|
1153
1163
|
*/
|
|
1154
1164
|
function getPropertyTable(tileContent, metadataClass) {
|
|
1155
1165
|
if (!tileContent) {
|
|
1156
1166
|
return null;
|
|
1157
1167
|
}
|
|
1168
|
+
let propertyTable;
|
|
1158
1169
|
const batchTableJson = tileContent?.batchTableJson;
|
|
1159
1170
|
if (batchTableJson) {
|
|
1160
1171
|
return batchTableJson;
|
|
1161
1172
|
}
|
|
1162
1173
|
const { extensionName, extension } = getPropertyTableExtension(tileContent);
|
|
1163
1174
|
switch (extensionName) {
|
|
1164
|
-
case
|
|
1165
|
-
|
|
1166
|
-
return
|
|
1175
|
+
case gltf_1.EXT_MESH_FEATURES: {
|
|
1176
|
+
propertyTable = getPropertyTableFromExtMeshFeatures(extension, metadataClass);
|
|
1177
|
+
return propertyTable;
|
|
1167
1178
|
}
|
|
1168
|
-
case
|
|
1169
|
-
|
|
1179
|
+
case gltf_1.EXT_STRUCTURAL_METADATA: {
|
|
1180
|
+
propertyTable = getPropertyTableFromExtStructuralMetadata(extension, metadataClass);
|
|
1181
|
+
return propertyTable;
|
|
1182
|
+
}
|
|
1183
|
+
case gltf_1.EXT_FEATURE_METADATA: {
|
|
1184
|
+
propertyTable = getPropertyTableFromExtFeatureMetadata(extension, metadataClass);
|
|
1185
|
+
return propertyTable;
|
|
1170
1186
|
}
|
|
1171
1187
|
default:
|
|
1172
1188
|
return null;
|
|
@@ -1178,7 +1194,11 @@ exports.getPropertyTable = getPropertyTable;
|
|
|
1178
1194
|
* @param tileContent - 3DTiles tile content
|
|
1179
1195
|
*/
|
|
1180
1196
|
function getPropertyTableExtension(tileContent) {
|
|
1181
|
-
const extensionsWithPropertyTables = [
|
|
1197
|
+
const extensionsWithPropertyTables = [
|
|
1198
|
+
gltf_1.EXT_FEATURE_METADATA,
|
|
1199
|
+
gltf_1.EXT_STRUCTURAL_METADATA,
|
|
1200
|
+
gltf_1.EXT_MESH_FEATURES
|
|
1201
|
+
];
|
|
1182
1202
|
const extensionsUsed = tileContent?.gltf?.extensionsUsed;
|
|
1183
1203
|
if (!extensionsUsed) {
|
|
1184
1204
|
return { extensionName: null, extension: null };
|
|
@@ -1199,6 +1219,8 @@ function getPropertyTableExtension(tileContent) {
|
|
|
1199
1219
|
/**
|
|
1200
1220
|
* Handle EXT_feature_metadata to get property table
|
|
1201
1221
|
* @param extension - global level of EXT_FEATURE_METADATA extension
|
|
1222
|
+
* @param metadataClass - user selected feature metadata class name
|
|
1223
|
+
* @returns {FeatureTableJson | null} Property table or null if the extension can't be handled properly.
|
|
1202
1224
|
*/
|
|
1203
1225
|
function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
|
|
1204
1226
|
if (extension?.featureTables) {
|
|
@@ -1238,3 +1260,62 @@ function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
|
|
|
1238
1260
|
console.warn("The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension.");
|
|
1239
1261
|
return null;
|
|
1240
1262
|
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Handle EXT_structural_metadata to get property table
|
|
1265
|
+
* @param extension - global level of EXT_STRUCTURAL_METADATA extension
|
|
1266
|
+
* @param metadataClass - user selected feature metadata class name
|
|
1267
|
+
* @returns {FeatureTableJson | null} Property table or null if the extension can't be handled properly.
|
|
1268
|
+
*/
|
|
1269
|
+
function getPropertyTableFromExtStructuralMetadata(extension, metadataClass) {
|
|
1270
|
+
if (extension?.propertyTables) {
|
|
1271
|
+
/**
|
|
1272
|
+
* Take only first feature table to generate attributes storage info object.
|
|
1273
|
+
* TODO: Think about getting data from all feature tables?
|
|
1274
|
+
* It can be tricky just because 3dTiles is able to have multiple featureId attributes and multiple feature tables.
|
|
1275
|
+
* In I3S we should decide which featureIds attribute will be passed to geometry data.
|
|
1276
|
+
*/
|
|
1277
|
+
const firstPropertyTable = extension?.propertyTables[0];
|
|
1278
|
+
const propertyTableWithData = {};
|
|
1279
|
+
for (const propertyName in firstPropertyTable.properties) {
|
|
1280
|
+
propertyTableWithData[propertyName] = firstPropertyTable.properties[propertyName].data;
|
|
1281
|
+
}
|
|
1282
|
+
return propertyTableWithData;
|
|
1283
|
+
}
|
|
1284
|
+
if (extension?.propertyTextures) {
|
|
1285
|
+
/**
|
|
1286
|
+
* Take only first feature table to generate attributes storage info object.
|
|
1287
|
+
* TODO: Think about getting data from all feature tables?
|
|
1288
|
+
* It can be tricky just because 3dTiles is able to have multiple featureId attributes and multiple feature tables.
|
|
1289
|
+
* In I3S we should decide which featureIds attribute will be passed to geometry data.
|
|
1290
|
+
*/
|
|
1291
|
+
if (extension?.propertyTextures) {
|
|
1292
|
+
const firstPropertyTexture = extension?.propertyTextures[0];
|
|
1293
|
+
const propertyTableWithData = {};
|
|
1294
|
+
for (const propertyName in firstPropertyTexture.properties) {
|
|
1295
|
+
propertyTableWithData[propertyName] = firstPropertyTexture.properties[propertyName].data;
|
|
1296
|
+
}
|
|
1297
|
+
return propertyTableWithData;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
console.warn("The I3S converter couldn't handle EXT_structural_metadata extension: There is neither propertyTables, no propertyTextures in the extension.");
|
|
1301
|
+
return null;
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* Handle EXT_mesh_features to get property table
|
|
1305
|
+
* @param extension - global level of EXT_MESH_FEATURES extension
|
|
1306
|
+
* @param metadataClass - user selected feature metadata class name
|
|
1307
|
+
* @returns {FeatureTableJson | null} Property table or null if the extension can't be handled properly.
|
|
1308
|
+
*/
|
|
1309
|
+
function getPropertyTableFromExtMeshFeatures(extension, metadataClass) {
|
|
1310
|
+
if (extension?.featureIds) {
|
|
1311
|
+
const firstFeatureId = extension?.featureIds[0];
|
|
1312
|
+
const propertyTableWithData = {};
|
|
1313
|
+
// When firstFeatureId.propertyTable is defined, the property data will be taken from EXT_structural_metadata extension
|
|
1314
|
+
if (!firstFeatureId.propertyTable) {
|
|
1315
|
+
console.warn('Should be implemented as we have the tileset with Ext_mesh_features not linked with EXT_structural_metadata extension');
|
|
1316
|
+
}
|
|
1317
|
+
return propertyTableWithData;
|
|
1318
|
+
}
|
|
1319
|
+
console.warn("The I3S converter couldn't handle EXT_mesh_features extension: There is no featureIds in the extension.");
|
|
1320
|
+
return null;
|
|
1321
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-index-document.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/node-index-document.ts"],"names":[],"mappings":"AACA,OAA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AAY,EAAE,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,qBAAqB,EAChC,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,iBAAiB,CAAC;IAY7B;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,mBAAmB;IAqBzF;;;;;;;;;;OAUG;WACU,uBAAuB,CAClC,UAAU,EAAE,iBAAiB,EAC7B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAAE,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,qBAAqB,GAC/B,OAAO,CAAC,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"node-index-document.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/node-index-document.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,UAAU,EAEX,MAAM,iBAAiB,CAAC;AAIzB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,UAAU,CAAC;AAE/C;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,cAAc;IACP,EAAE,EAAE,MAAM,CAAC;IAClB,uBAAuB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACxB,+BAA+B;IACxB,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAQ;IAC/C,eAAe;IACR,QAAQ,EAAE,iBAAiB,EAAE,CAAM;IAC1C,yBAAyB;IACzB,OAAO,CAAC,SAAS,CAAe;IAEhC;;;OAGG;IACH,OAAO,CAAC,UAAU,CAAkB;IACpC,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED;;;;OAIG;gBACS,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY;IAM/C;;;;OAIG;IACU,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAS3E;;;OAGG;IACU,WAAW,CAAC,UAAU,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BxE;;OAEG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAmC1C,+CAA+C;IAClC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAMlC,wBAAwB;IACxB,OAAO,CAAC,QAAQ;IAOhB;;;OAGG;YACW,KAAK;IAyBnB;;;OAGG;YACW,IAAI;IAalB;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;;;;OAKG;WACU,cAAc,CACzB,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,iBAAiB,CAAC;IAM7B;;;;;;;;;OASG;WACU,UAAU,CACrB,UAAU,EAAE,iBAAiB,EAC7B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAAE,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,qBAAqB,EAChC,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC,iBAAiB,CAAC;IAY7B;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,mBAAmB;IAqBzF;;;;;;;;;;OAUG;WACU,uBAAuB,CAClC,UAAU,EAAE,iBAAiB,EAC7B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAAE,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,qBAAqB,GAC/B,OAAO,CAAC,mBAAmB,CAAC;CAgDhC"}
|
|
@@ -256,7 +256,10 @@ class NodeIndexDocument {
|
|
|
256
256
|
attributes.length &&
|
|
257
257
|
parentNode.converter.layers0?.attributeStorageInfo?.length) {
|
|
258
258
|
node.attributeData = [];
|
|
259
|
-
|
|
259
|
+
const minimumLength = attributes.length < parentNode.converter.layers0.attributeStorageInfo.length
|
|
260
|
+
? attributes.length
|
|
261
|
+
: parentNode.converter.layers0.attributeStorageInfo.length;
|
|
262
|
+
for (let index = 0; index < minimumLength; index++) {
|
|
260
263
|
const folderName = parentNode.converter.layers0.attributeStorageInfo[index].key;
|
|
261
264
|
node.attributeData.push({ href: `./attributes/${folderName}/0` });
|
|
262
265
|
}
|
|
@@ -4,7 +4,7 @@ exports.mergePreprocessData = exports.analyzeTileContent = exports.GLTF_PRIMITIV
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const gltf_1 = require("@loaders.gl/gltf");
|
|
6
6
|
const core_1 = require("@loaders.gl/core");
|
|
7
|
-
const
|
|
7
|
+
const gltf_2 = require("@loaders.gl/gltf");
|
|
8
8
|
/**
|
|
9
9
|
* glTF primitive modes
|
|
10
10
|
* @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode
|
|
@@ -72,7 +72,7 @@ const getMeshTypesFromGltf = (gltfJson) => {
|
|
|
72
72
|
*/
|
|
73
73
|
const getMetadataClassesFromGltf = (gltfJson) => {
|
|
74
74
|
const result = new Set();
|
|
75
|
-
const classes = gltfJson.extensions?.[
|
|
75
|
+
const classes = gltfJson.extensions?.[gltf_2.EXT_FEATURE_METADATA]
|
|
76
76
|
?.schema?.classes;
|
|
77
77
|
if (classes) {
|
|
78
78
|
for (const classKey of Object.keys(classes)) {
|
|
@@ -147,7 +147,7 @@ export default class I3SConverter {
|
|
|
147
147
|
* @param boundingVolume - initialized bounding volume of the source tile
|
|
148
148
|
* @param tileContent - content of the source tile
|
|
149
149
|
* @param parentId - id of parent node in node pages
|
|
150
|
-
* @param propertyTable - batch table from b3dm / feature properties from EXT_FEATURE_METADATA
|
|
150
|
+
* @param propertyTable - batch table from b3dm / feature properties from EXT_FEATURE_METADATA, EXT_MESH_FEATURES or EXT_STRUCTURAL_METADATA
|
|
151
151
|
* @returns - converted node resources
|
|
152
152
|
*/
|
|
153
153
|
private _convertResources;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"AAEA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AAC;QAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC,MAAM,CAAC;IAkFnB;;;;OAIG;YACW,oBAAoB;IAgElC;;;;;OAKG;YACW,WAAW;IA8BzB;;;;OAIG;YACW,qBAAqB;IA2EnC;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAgCpB;;OAEG;YACW,aAAa;IAc3B;;;OAGG;YACW,WAAW;IAsCzB;;;;;;OAMG;YACW,WAAW;IAkCzB;;;;OAIG;YACW,YAAY;IAc1B;;;;;;;OAOG;YACW,WAAW;IA6GzB;;;;;;;;;;OAUG;YACW,iBAAiB;IAkC/B;;;;;;;;;;;;;;OAcG;YACW,sBAAsB;IA+DpC;;;;;;;;;OASG;YACW,eAAe;IAiB7B;;;;;;OAMG;YACW,gBAAgB;IAoC9B;;;;;;OAMG;YACW,YAAY;IAwB1B;;;;;OAKG;YACW,aAAa;IAmE3B;;;;;;;OAOG;YACW,gBAAgB;IAwB9B;;;;;OAKG;YACW,gBAAgB;IA+B9B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAU7B;;;;;;OAMG;IACH,OAAO,CAAC,8BAA8B;IAWtC;;;OAGG;IACH,OAAO,CAAC,qCAAqC;IAqC7C;;;OAGG;YACW,iBAAiB;IAqB/B;;OAEG;YACW,oBAAoB;IAYlC;;OAEG;YACW,qBAAqB;IAiBnC;;OAEG;IACH,OAAO,CAAC,8BAA8B;IAWtC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;CAG3B"}
|
|
@@ -481,7 +481,14 @@ class I3SConverter {
|
|
|
481
481
|
const sourceBoundingVolume = (0, tiles_1.createBoundingVolume)(sourceTile.boundingVolume, transformationMatrix, null);
|
|
482
482
|
let boundingVolumes = (0, coordinate_converter_1.createBoundingVolumes)(sourceBoundingVolume, this.geoidHeightModel);
|
|
483
483
|
const propertyTable = (0, geometry_converter_1.getPropertyTable)(tileContent, this.options.metadataClass);
|
|
484
|
-
if (propertyTable
|
|
484
|
+
if (propertyTable) {
|
|
485
|
+
/*
|
|
486
|
+
Call the convertion procedure even if the node attributes have been already created.
|
|
487
|
+
We will append new attributes only in case the property table is updated.
|
|
488
|
+
According to ver 1.9 (see https://github.com/Esri/i3s-spec/blob/master/docs/1.9/attributeStorageInfo.cmn.md):
|
|
489
|
+
"The attributeStorageInfo object describes the structure of the binary attribute data resource of a layer, which is the same for every node in the layer."
|
|
490
|
+
But the specification of ver 2.1 doesn't have such a requirement ("...the same for every node...")
|
|
491
|
+
*/
|
|
485
492
|
this._convertPropertyTableToNodeAttributes(propertyTable);
|
|
486
493
|
}
|
|
487
494
|
const resourcesData = await this._convertResources(sourceTile, transformationMatrix, sourceBoundingVolume, tileContent, parentNode.inPageId, propertyTable);
|
|
@@ -533,7 +540,7 @@ class I3SConverter {
|
|
|
533
540
|
* @param boundingVolume - initialized bounding volume of the source tile
|
|
534
541
|
* @param tileContent - content of the source tile
|
|
535
542
|
* @param parentId - id of parent node in node pages
|
|
536
|
-
* @param propertyTable - batch table from b3dm / feature properties from EXT_FEATURE_METADATA
|
|
543
|
+
* @param propertyTable - batch table from b3dm / feature properties from EXT_FEATURE_METADATA, EXT_MESH_FEATURES or EXT_STRUCTURAL_METADATA
|
|
537
544
|
* @returns - converted node resources
|
|
538
545
|
*/
|
|
539
546
|
async _convertResources(sourceTile, transformationMatrix, boundingVolume, tileContent, parentId, propertyTable) {
|
|
@@ -780,7 +787,10 @@ class I3SConverter {
|
|
|
780
787
|
*/
|
|
781
788
|
async _writeAttributes(attributes = [], childPath, slpkChildPath) {
|
|
782
789
|
if (attributes?.length && this.layers0?.attributeStorageInfo?.length) {
|
|
783
|
-
|
|
790
|
+
const minimumLength = attributes.length < this.layers0.attributeStorageInfo.length
|
|
791
|
+
? attributes.length
|
|
792
|
+
: this.layers0.attributeStorageInfo.length;
|
|
793
|
+
for (let index = 0; index < minimumLength; index++) {
|
|
784
794
|
const folderName = this.layers0.attributeStorageInfo[index].key;
|
|
785
795
|
const fileBuffer = new Uint8Array(attributes[index]);
|
|
786
796
|
if (this.options.slpk) {
|
|
@@ -857,16 +867,25 @@ class I3SConverter {
|
|
|
857
867
|
...propertyTable
|
|
858
868
|
};
|
|
859
869
|
for (const key in propertyTableWithObjectId) {
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
this.layers0.attributeStorageInfo.
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
+
/*
|
|
871
|
+
We will append new attributes only in case the property table is updated.
|
|
872
|
+
According to ver 1.9 (see https://github.com/Esri/i3s-spec/blob/master/docs/1.9/attributeStorageInfo.cmn.md):
|
|
873
|
+
"The attributeStorageInfo object describes the structure of the binary attribute data resource of a layer, which is the same for every node in the layer."
|
|
874
|
+
But the specification of ver 2.1 doesn't have such a requirement ("...the same for every node...")
|
|
875
|
+
*/
|
|
876
|
+
const found = this.layers0.attributeStorageInfo.find((element) => element.name === key);
|
|
877
|
+
if (!found) {
|
|
878
|
+
const firstAttribute = propertyTableWithObjectId[key][0];
|
|
879
|
+
const attributeType = (0, feature_attributes_1.getAttributeType)(key, firstAttribute);
|
|
880
|
+
const storageAttribute = (0, feature_attributes_1.createdStorageAttribute)(attributeIndex, key, attributeType);
|
|
881
|
+
const fieldAttributeType = (0, feature_attributes_1.getFieldAttributeType)(attributeType);
|
|
882
|
+
const fieldAttribute = (0, feature_attributes_1.createFieldAttribute)(key, fieldAttributeType);
|
|
883
|
+
const popupInfo = (0, feature_attributes_1.createPopupInfo)(propertyTableWithObjectId);
|
|
884
|
+
this.layers0.attributeStorageInfo.push(storageAttribute);
|
|
885
|
+
this.layers0.fields.push(fieldAttribute);
|
|
886
|
+
this.layers0.popupInfo = popupInfo;
|
|
887
|
+
this.layers0.layerType = _3D_OBJECT_LAYER_TYPE;
|
|
888
|
+
}
|
|
870
889
|
attributeIndex += 1;
|
|
871
890
|
}
|
|
872
891
|
}
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getFileByUrl = exports.loadArchive = void 0;
|
|
4
4
|
require("@loaders.gl/polyfills");
|
|
5
5
|
const i3s_1 = require("@loaders.gl/i3s");
|
|
6
|
-
const
|
|
6
|
+
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
7
7
|
let slpkArchive;
|
|
8
8
|
/**
|
|
9
9
|
* Open SLPK file for reading and load HASH file
|
|
10
10
|
* @param fullLayerPath - full path to SLPK file
|
|
11
11
|
*/
|
|
12
12
|
const loadArchive = async (fullLayerPath) => {
|
|
13
|
-
slpkArchive = await (0, i3s_1.parseSLPK)(await
|
|
13
|
+
slpkArchive = await (0, i3s_1.parseSLPK)(await loader_utils_1.FileHandleFile.from(fullLayerPath), (msg) => console.log(msg));
|
|
14
14
|
console.log('The server is ready to use');
|
|
15
15
|
};
|
|
16
16
|
exports.loadArchive = loadArchive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slpk-extractor.d.ts","sourceRoot":"","sources":["../../src/slpk-extractor/slpk-extractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slpk-extractor.d.ts","sourceRoot":"","sources":["../../src/slpk-extractor/slpk-extractor.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC;;;;;OAKG;IACU,OAAO,CAAC,OAAO,EAAE;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IA8BtF;;;OAGG;IAEH,OAAO,CAAC,iBAAiB;YAYX,MAAM;YAWN,SAAS;CASxB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@loaders.gl/core");
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
5
|
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
6
|
+
const loader_utils_2 = require("@loaders.gl/loader-utils");
|
|
6
7
|
const zip_1 = require("@loaders.gl/zip");
|
|
7
8
|
const compression_1 = require("@loaders.gl/compression");
|
|
8
9
|
const file_utils_1 = require("../lib/utils/file-utils");
|
|
@@ -27,7 +28,7 @@ class SLPKExtractor {
|
|
|
27
28
|
return constants_1.BROWSER_ERROR_MESSAGE;
|
|
28
29
|
}
|
|
29
30
|
const { inputUrl } = options;
|
|
30
|
-
const provider = await
|
|
31
|
+
const provider = await loader_utils_2.FileHandleFile.from(inputUrl);
|
|
31
32
|
let localHeader = await (0, zip_1.parseZipLocalFileHeader)(0n, provider);
|
|
32
33
|
while (localHeader) {
|
|
33
34
|
await this.writeFile(await this.unGzip({
|