@loaders.gl/tile-converter 4.0.0-alpha.9 → 4.0.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.
- package/bin/i3s-server.js +4 -0
- package/bin/slpk-extractor.js +4 -0
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +5 -5
- package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +10 -5
- package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/helpers/load-i3s.d.ts +10 -0
- package/dist/3d-tiles-converter/helpers/load-i3s.d.ts.map +1 -0
- package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +2 -1
- package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +1 -1
- package/dist/converter.min.js +172 -103
- package/dist/deps-installer/deps-installer.d.ts +3 -2
- package/dist/deps-installer/deps-installer.d.ts.map +1 -1
- package/dist/dist.min.js +32715 -32567
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +97 -117
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +24 -22
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/load-i3s.js +63 -0
- package/dist/es5/3d-tiles-converter/helpers/load-i3s.js.map +1 -0
- package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
- package/dist/es5/converter-cli.js +25 -65
- package/dist/es5/converter-cli.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +113 -39
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +45 -15
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/feature-attributes.js +8 -18
- package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +83 -43
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +100 -102
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/load-3d-tiles.js +70 -4
- package/dist/es5/i3s-converter/helpers/load-3d-tiles.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 +47 -12
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +187 -174
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-converter/types.js +11 -11
- package/dist/es5/i3s-converter/types.js.map +1 -1
- package/dist/es5/i3s-server/README.md +46 -2
- package/dist/es5/i3s-server/app.js +23 -15
- package/dist/es5/i3s-server/app.js.map +1 -1
- package/dist/es5/i3s-server/bin/www.js +33 -0
- package/dist/es5/i3s-server/bin/www.js.map +1 -0
- package/dist/es5/i3s-server/controllers/index-controller.js +23 -22
- package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -1
- package/dist/es5/i3s-server/controllers/slpk-controller.js +35 -38
- package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/es5/i3s-server/routes/index.js +2 -2
- package/dist/es5/i3s-server/routes/index.js.map +1 -1
- package/dist/es5/i3s-server/routes/slpk-router.js +14 -13
- package/dist/es5/i3s-server/routes/slpk-router.js.map +1 -1
- package/dist/es5/i3s-server/utils/create-scene-server.js +7 -4
- package/dist/es5/i3s-server/utils/create-scene-server.js.map +1 -1
- package/dist/es5/i3s-server/utils/server-utils.js +49 -0
- package/dist/es5/i3s-server/utils/server-utils.js.map +1 -0
- package/dist/es5/lib/utils/cli-utils.js +57 -0
- package/dist/es5/lib/utils/cli-utils.js.map +1 -0
- package/dist/es5/lib/utils/compress-util.js +1 -1
- package/dist/es5/lib/utils/compress-util.js.map +1 -1
- package/dist/es5/lib/utils/lod-conversion-utils.js +10 -4
- package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/es5/pgm-loader.js +11 -3
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/es5/slpk-extractor/slpk-extractor.js +171 -0
- package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -0
- package/dist/es5/slpk-extractor-cli.js +117 -0
- package/dist/es5/slpk-extractor-cli.js.map +1 -0
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +51 -58
- package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +12 -11
- package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/load-i3s.js +32 -0
- package/dist/esm/3d-tiles-converter/helpers/load-i3s.js.map +1 -0
- package/dist/esm/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
- package/dist/esm/converter-cli.js +8 -48
- package/dist/esm/converter-cli.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +38 -12
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +28 -11
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/feature-attributes.js +10 -8
- package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +77 -34
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +60 -61
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/load-3d-tiles.js +33 -4
- package/dist/esm/i3s-converter/helpers/load-3d-tiles.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 +37 -12
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +101 -73
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/i3s-converter/types.js +9 -9
- package/dist/esm/i3s-converter/types.js.map +1 -1
- package/dist/esm/i3s-server/README.md +46 -2
- package/dist/esm/i3s-server/app.js +13 -11
- package/dist/esm/i3s-server/app.js.map +1 -1
- package/dist/esm/i3s-server/bin/i3s-server.min.js +516 -0
- package/dist/esm/i3s-server/bin/www.js +30 -0
- package/dist/esm/i3s-server/bin/www.js.map +1 -0
- package/dist/esm/i3s-server/controllers/index-controller.js +4 -7
- package/dist/esm/i3s-server/controllers/index-controller.js.map +1 -1
- package/dist/esm/i3s-server/controllers/slpk-controller.js +9 -26
- package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/esm/i3s-server/routes/index.js +1 -1
- package/dist/esm/i3s-server/routes/index.js.map +1 -1
- package/dist/esm/i3s-server/routes/slpk-router.js +5 -11
- package/dist/esm/i3s-server/routes/slpk-router.js.map +1 -1
- package/dist/esm/i3s-server/utils/create-scene-server.js +2 -5
- package/dist/esm/i3s-server/utils/create-scene-server.js.map +1 -1
- package/dist/esm/i3s-server/utils/server-utils.js +40 -0
- package/dist/esm/i3s-server/utils/server-utils.js.map +1 -0
- package/dist/esm/lib/utils/cli-utils.js +47 -0
- package/dist/esm/lib/utils/cli-utils.js.map +1 -0
- package/dist/esm/lib/utils/compress-util.js +1 -1
- package/dist/esm/lib/utils/compress-util.js.map +1 -1
- package/dist/esm/lib/utils/lod-conversion-utils.js +6 -4
- package/dist/esm/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/esm/pgm-loader.js +7 -4
- package/dist/esm/pgm-loader.js.map +1 -1
- package/dist/esm/slpk-extractor/slpk-extractor.js +63 -0
- package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -0
- package/dist/esm/slpk-extractor-cli.js +74 -0
- package/dist/esm/slpk-extractor-cli.js.map +1 -0
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +15 -2
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts +1 -2
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/feature-attributes.d.ts +8 -8
- package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +9 -9
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts +3 -3
- package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/load-3d-tiles.d.ts +15 -0
- package/dist/i3s-converter/helpers/load-3d-tiles.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts +4 -5
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.d.ts +3 -2
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/types.d.ts +48 -7
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/i3s-server/app.d.ts +1 -2
- package/dist/i3s-server/app.d.ts.map +1 -1
- package/dist/i3s-server/bin/www.d.ts +3 -0
- package/dist/i3s-server/bin/www.d.ts.map +1 -0
- package/dist/i3s-server/controllers/index-controller.d.ts +6 -1
- package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -1
- package/dist/i3s-server/controllers/slpk-controller.d.ts +13 -2
- package/dist/i3s-server/controllers/slpk-controller.d.ts.map +1 -1
- package/dist/i3s-server/routes/index.d.ts +1 -2
- package/dist/i3s-server/routes/index.d.ts.map +1 -1
- package/dist/i3s-server/routes/slpk-router.d.ts +2 -2
- package/dist/i3s-server/routes/slpk-router.d.ts.map +1 -1
- package/dist/i3s-server/utils/create-scene-server.d.ts +11 -5
- package/dist/i3s-server/utils/create-scene-server.d.ts.map +1 -1
- package/dist/i3s-server/utils/server-utils.d.ts +24 -0
- package/dist/i3s-server/utils/server-utils.d.ts.map +1 -0
- package/dist/lib/utils/cli-utils.d.ts +34 -0
- package/dist/lib/utils/cli-utils.d.ts.map +1 -0
- package/dist/lib/utils/lod-conversion-utils.d.ts +2 -2
- package/dist/lib/utils/lod-conversion-utils.d.ts.map +1 -1
- package/dist/pgm-loader.d.ts +9 -2
- package/dist/pgm-loader.d.ts.map +1 -1
- package/dist/slpk-extractor/slpk-extractor.d.ts +23 -0
- package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -0
- package/dist/slpk-extractor-cli.d.ts +17 -0
- package/dist/slpk-extractor-cli.d.ts.map +1 -0
- package/dist/slpk-extractor.min.js +189 -0
- package/package.json +27 -21
- package/src/3d-tiles-converter/3d-tiles-converter.ts +65 -69
- package/src/3d-tiles-converter/helpers/b3dm-converter.ts +23 -19
- package/src/3d-tiles-converter/helpers/load-i3s.ts +52 -0
- package/src/3d-tiles-converter/helpers/texture-atlas.ts +6 -2
- package/src/converter-cli.ts +16 -74
- package/src/deps-installer/deps-installer.ts +56 -11
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +77 -32
- package/src/i3s-converter/helpers/coordinate-converter.ts +1 -2
- package/src/i3s-converter/helpers/feature-attributes.ts +23 -18
- package/src/i3s-converter/helpers/geometry-attributes.ts +81 -44
- package/src/i3s-converter/helpers/geometry-converter.ts +149 -126
- package/src/i3s-converter/helpers/gltf-attributes.ts +9 -10
- package/src/i3s-converter/helpers/load-3d-tiles.ts +61 -5
- package/src/i3s-converter/helpers/node-index-document.ts +5 -1
- package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +70 -21
- package/src/i3s-converter/i3s-converter.ts +145 -73
- package/src/i3s-converter/types.ts +49 -7
- package/src/i3s-server/README.md +46 -2
- package/src/i3s-server/{app.js → app.ts} +11 -9
- package/src/i3s-server/bin/www.ts +38 -0
- package/src/i3s-server/controllers/{index-controller.js → index-controller.ts} +10 -9
- package/src/i3s-server/controllers/slpk-controller.ts +32 -0
- package/src/i3s-server/routes/{index.js → index.ts} +2 -1
- package/src/i3s-server/routes/{slpk-router.js → slpk-router.ts} +5 -10
- package/src/i3s-server/utils/create-scene-server.ts +20 -0
- package/src/i3s-server/utils/server-utils.ts +70 -0
- package/src/lib/utils/cli-utils.ts +78 -0
- package/src/lib/utils/compress-util.ts +1 -1
- package/src/lib/utils/lod-conversion-utils.ts +10 -6
- package/src/pgm-loader.ts +15 -7
- package/src/slpk-extractor/slpk-extractor.ts +101 -0
- package/src/slpk-extractor-cli.ts +128 -0
- package/dist/3d-tiles-attributes-worker.d.ts +0 -28
- package/dist/3d-tiles-attributes-worker.d.ts.map +0 -1
- package/dist/3d-tiles-attributes-worker.js +0 -3
- package/dist/3d-tiles-attributes-worker.js.map +0 -7
- package/dist/3d-tiles-converter/3d-tiles-converter.js +0 -288
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +0 -269
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -23
- package/dist/3d-tiles-converter/helpers/texture-atlas.js +0 -52
- package/dist/3d-tiles-converter/json-templates/tileset.js +0 -43
- package/dist/bundle.js +0 -5
- package/dist/constants.js +0 -4
- package/dist/converter-cli.js +0 -280
- package/dist/deps-installer/deps-installer.js +0 -63
- package/dist/es5/3d-tiles-attributes-worker.js +0 -25
- package/dist/es5/3d-tiles-attributes-worker.js.map +0 -1
- package/dist/es5/i3s-attributes-worker.js +0 -25
- package/dist/es5/i3s-attributes-worker.js.map +0 -1
- package/dist/es5/i3s-server/bin/www +0 -102
- package/dist/es5/workers/3d-tiles-attributes-worker.js +0 -28
- package/dist/es5/workers/3d-tiles-attributes-worker.js.map +0 -1
- package/dist/es5/workers/i3s-attributes-worker.js +0 -30
- package/dist/es5/workers/i3s-attributes-worker.js.map +0 -1
- package/dist/esm/3d-tiles-attributes-worker.js +0 -16
- package/dist/esm/3d-tiles-attributes-worker.js.map +0 -1
- package/dist/esm/i3s-attributes-worker.js +0 -16
- package/dist/esm/i3s-attributes-worker.js.map +0 -1
- package/dist/esm/i3s-server/bin/www +0 -102
- package/dist/esm/workers/3d-tiles-attributes-worker.js +0 -8
- package/dist/esm/workers/3d-tiles-attributes-worker.js.map +0 -1
- package/dist/esm/workers/i3s-attributes-worker.js +0 -7
- package/dist/esm/workers/i3s-attributes-worker.js.map +0 -1
- package/dist/i3s-attributes-worker.d.ts +0 -45
- package/dist/i3s-attributes-worker.d.ts.map +0 -1
- package/dist/i3s-attributes-worker.js +0 -9
- package/dist/i3s-attributes-worker.js.map +0 -7
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +0 -138
- package/dist/i3s-converter/helpers/coordinate-converter.js +0 -123
- package/dist/i3s-converter/helpers/create-scene-server-path.js +0 -28
- package/dist/i3s-converter/helpers/feature-attributes.js +0 -216
- package/dist/i3s-converter/helpers/geometry-attributes.js +0 -202
- package/dist/i3s-converter/helpers/geometry-converter.js +0 -1225
- package/dist/i3s-converter/helpers/gltf-attributes.js +0 -128
- package/dist/i3s-converter/helpers/load-3d-tiles.js +0 -53
- package/dist/i3s-converter/helpers/node-debug.js +0 -120
- package/dist/i3s-converter/helpers/node-index-document.js +0 -268
- package/dist/i3s-converter/helpers/node-pages.js +0 -316
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +0 -76
- package/dist/i3s-converter/helpers/tileset-traversal.js +0 -29
- package/dist/i3s-converter/i3s-converter.js +0 -911
- package/dist/i3s-converter/json-templates/geometry-definitions.js +0 -87
- package/dist/i3s-converter/json-templates/layers.js +0 -139
- package/dist/i3s-converter/json-templates/metadata.js +0 -25
- package/dist/i3s-converter/json-templates/node.js +0 -89
- package/dist/i3s-converter/json-templates/scene-server.js +0 -31
- package/dist/i3s-converter/json-templates/shared-resources.js +0 -129
- package/dist/i3s-converter/json-templates/store.js +0 -103
- package/dist/i3s-converter/types.js +0 -17
- package/dist/i3s-server/app.js +0 -22
- package/dist/i3s-server/controllers/index-controller.js +0 -23
- package/dist/i3s-server/controllers/slpk-controller.js +0 -32
- package/dist/i3s-server/routes/index.js +0 -16
- package/dist/i3s-server/routes/slpk-router.js +0 -33
- package/dist/i3s-server/utils/create-scene-server.js +0 -14
- package/dist/index.js +0 -10
- package/dist/lib/utils/compress-util.js +0 -257
- package/dist/lib/utils/file-utils.js +0 -139
- package/dist/lib/utils/geometry-utils.js +0 -18
- package/dist/lib/utils/lod-conversion-utils.js +0 -76
- package/dist/lib/utils/queue.js +0 -18
- package/dist/lib/utils/statistic-utills.js +0 -64
- package/dist/lib/utils/write-queue.js +0 -80
- package/dist/pgm-loader.js +0 -24
- package/dist/workers/3d-tiles-attributes-worker.d.ts +0 -2
- package/dist/workers/3d-tiles-attributes-worker.d.ts.map +0 -1
- package/dist/workers/3d-tiles-attributes-worker.js +0 -9
- package/dist/workers/i3s-attributes-worker.d.ts +0 -2
- package/dist/workers/i3s-attributes-worker.d.ts.map +0 -1
- package/dist/workers/i3s-attributes-worker.js +0 -5
- package/src/3d-tiles-attributes-worker.ts +0 -43
- package/src/i3s-attributes-worker.ts +0 -59
- package/src/i3s-server/bin/www +0 -102
- package/src/i3s-server/controllers/slpk-controller.js +0 -38
- package/src/i3s-server/utils/create-scene-server.js +0 -15
- package/src/workers/3d-tiles-attributes-worker.ts +0 -6
- package/src/workers/i3s-attributes-worker.ts +0 -7
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { isBrowser } from '@loaders.gl/core';
|
|
2
|
+
import { BROWSER_ERROR_MESSAGE } from '../constants';
|
|
3
|
+
import { path } from '@loaders.gl/loader-utils';
|
|
4
|
+
import { FileHandleFile } from '@loaders.gl/loader-utils';
|
|
5
|
+
import { parseZipLocalFileHeader } from '@loaders.gl/zip';
|
|
6
|
+
import { GZipCompression } from '@loaders.gl/compression';
|
|
7
|
+
import { writeFile } from '../lib/utils/file-utils';
|
|
8
|
+
const indexNames = ['3dSceneLayer.json.gz', '3dNodeIndexDocument.json.gz', 'sharedResource.json.gz'];
|
|
9
|
+
export default class SLPKExtractor {
|
|
10
|
+
async extract(options) {
|
|
11
|
+
if (isBrowser) {
|
|
12
|
+
console.log(BROWSER_ERROR_MESSAGE);
|
|
13
|
+
return BROWSER_ERROR_MESSAGE;
|
|
14
|
+
}
|
|
15
|
+
const {
|
|
16
|
+
inputUrl
|
|
17
|
+
} = options;
|
|
18
|
+
const provider = await FileHandleFile.from(inputUrl);
|
|
19
|
+
let localHeader = await parseZipLocalFileHeader(0n, provider);
|
|
20
|
+
while (localHeader) {
|
|
21
|
+
var _localHeader;
|
|
22
|
+
await this.writeFile(await this.unGzip({
|
|
23
|
+
name: this.correctIndexNames(localHeader.fileName),
|
|
24
|
+
data: await provider.slice(localHeader.fileDataOffset, localHeader.fileDataOffset + localHeader.compressedSize)
|
|
25
|
+
}), options.outputPath);
|
|
26
|
+
localHeader = await parseZipLocalFileHeader(localHeader.fileDataOffset + ((_localHeader = localHeader) === null || _localHeader === void 0 ? void 0 : _localHeader.compressedSize), provider);
|
|
27
|
+
}
|
|
28
|
+
return 'success';
|
|
29
|
+
}
|
|
30
|
+
correctIndexNames(fileName) {
|
|
31
|
+
if (indexNames.includes(path.filename(path.join('/', fileName)))) {
|
|
32
|
+
return path.join(path.dirname(fileName), 'index.json.gz');
|
|
33
|
+
}
|
|
34
|
+
let parts = /^(.*\/[^\/\.]*)(\..+)$/.exec(fileName);
|
|
35
|
+
if (!parts) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return "".concat(parts === null || parts === void 0 ? void 0 : parts.at(1), "/index").concat(parts === null || parts === void 0 ? void 0 : parts.at(2));
|
|
39
|
+
}
|
|
40
|
+
async unGzip(file) {
|
|
41
|
+
var _file$name;
|
|
42
|
+
if (/\.gz$/.test((_file$name = file.name) !== null && _file$name !== void 0 ? _file$name : '')) {
|
|
43
|
+
var _file$name2;
|
|
44
|
+
const compression = new GZipCompression();
|
|
45
|
+
const decompressedData = await compression.decompress(file.data);
|
|
46
|
+
return {
|
|
47
|
+
data: decompressedData,
|
|
48
|
+
name: ((_file$name2 = file.name) !== null && _file$name2 !== void 0 ? _file$name2 : '').slice(0, -3)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return Promise.resolve(file);
|
|
52
|
+
}
|
|
53
|
+
async writeFile(options, outputPath) {
|
|
54
|
+
if (!options.name) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const finalPath = path.join(outputPath, options.name);
|
|
58
|
+
const dirName = path.dirname(finalPath);
|
|
59
|
+
const fileName = path.filename(finalPath);
|
|
60
|
+
await writeFile(dirName, options.data, fileName);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=slpk-extractor.js.map
|
|
@@ -0,0 +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} 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;IAC7D,OAAOE,WAAW,EAAE;MAAA,IAAAC,YAAA;MAClB,MAAM,IAAI,CAACX,SAAS,CAClB,MAAM,IAAI,CAACY,MAAM,CAAC;QAChBC,IAAI,EAAE,IAAI,CAACC,iBAAiB,CAACJ,WAAW,CAACK,QAAQ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,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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import '@loaders.gl/polyfills';
|
|
2
|
+
import SLPKExtractor from './slpk-extractor/slpk-extractor';
|
|
3
|
+
import { getURLValue, validateOptionsWithEqual } from './lib/utils/cli-utils';
|
|
4
|
+
async function main() {
|
|
5
|
+
const [,, ...args] = process.argv;
|
|
6
|
+
if (args.length === 0) {
|
|
7
|
+
printHelp();
|
|
8
|
+
}
|
|
9
|
+
const validatedOptionsArr = validateOptionsWithEqual(args);
|
|
10
|
+
const options = parseOptions(validatedOptionsArr);
|
|
11
|
+
const validatedOptions = validateOptions(options);
|
|
12
|
+
await convert(validatedOptions);
|
|
13
|
+
}
|
|
14
|
+
main().catch(error => {
|
|
15
|
+
console.log(error);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
});
|
|
18
|
+
function printHelp() {
|
|
19
|
+
console.log('cli: converter slpk to I3S...');
|
|
20
|
+
console.log('--output [Output folder, default: "data" folder]');
|
|
21
|
+
console.log('--tileset [SLPK file]');
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
async function convert(options) {
|
|
25
|
+
console.log("------------------------------------------------");
|
|
26
|
+
console.log("Starting conversion of SLPK");
|
|
27
|
+
console.log("------------------------------------------------");
|
|
28
|
+
const slpkExtractor = new SLPKExtractor();
|
|
29
|
+
slpkExtractor.extract({
|
|
30
|
+
inputUrl: options.tileset,
|
|
31
|
+
outputPath: options.output
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function validateOptions(options) {
|
|
35
|
+
const mandatoryOptionsWithExceptions = {
|
|
36
|
+
output: () => console.log('Missed: --output [Output path name]'),
|
|
37
|
+
tileset: () => console.log('Missed: --tileset [SLPK file]')
|
|
38
|
+
};
|
|
39
|
+
const exceptions = [];
|
|
40
|
+
for (const mandatoryOption in mandatoryOptionsWithExceptions) {
|
|
41
|
+
const optionValue = options[mandatoryOption];
|
|
42
|
+
if (!optionValue) {
|
|
43
|
+
exceptions.push(mandatoryOptionsWithExceptions[mandatoryOption]);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (exceptions.length) {
|
|
47
|
+
exceptions.forEach(exeption => exeption());
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
return options;
|
|
51
|
+
}
|
|
52
|
+
function parseOptions(args) {
|
|
53
|
+
const opts = {};
|
|
54
|
+
args.forEach((arg, index) => {
|
|
55
|
+
if (arg.indexOf('--') === 0) {
|
|
56
|
+
switch (arg) {
|
|
57
|
+
case '--tileset':
|
|
58
|
+
opts.tileset = getURLValue(index, args);
|
|
59
|
+
break;
|
|
60
|
+
case '--output':
|
|
61
|
+
opts.output = getURLValue(index, args);
|
|
62
|
+
break;
|
|
63
|
+
case '--help':
|
|
64
|
+
printHelp();
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
console.warn("Unknown option ".concat(arg));
|
|
68
|
+
process.exit(0);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return opts;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=slpk-extractor-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slpk-extractor-cli.js","names":["SLPKExtractor","getURLValue","validateOptionsWithEqual","main","args","process","argv","length","printHelp","validatedOptionsArr","options","parseOptions","validatedOptions","validateOptions","convert","catch","error","console","log","exit","slpkExtractor","extract","inputUrl","tileset","outputPath","output","mandatoryOptionsWithExceptions","exceptions","mandatoryOption","optionValue","push","forEach","exeption","opts","arg","index","indexOf","warn","concat"],"sources":["../../src/slpk-extractor-cli.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport '@loaders.gl/polyfills';\nimport SLPKExtractor from './slpk-extractor/slpk-extractor';\nimport {getURLValue, validateOptionsWithEqual} from './lib/utils/cli-utils';\n\ntype SLPKExtractionOptions = {\n /** \"tileset.json\" file (3DTiles) / \"http://..../SceneServer/layers/0\" resource (I3S) */\n tileset?: string;\n /** Output folder. This folder will be created by converter if doesn't exist. It is relative to the converter path.\n * Default: \"data\" folder */\n output?: string;\n};\n\n/* During validation we check that particular options are defined so they can't be undefined */\nexport type ValidatedSLPKExtractionOptions = SLPKExtractionOptions & {\n /** slpk file */\n tileset: string;\n /** Output folder. This folder will be created by converter if doesn't exist. It is relative to the converter path.\n * Default: \"data\" folder */\n output: string;\n};\n\n/**\n * CLI entry\n * @returns\n */\nasync function main() {\n const [, , ...args] = process.argv;\n\n if (args.length === 0) {\n printHelp();\n }\n\n const validatedOptionsArr = validateOptionsWithEqual(args);\n\n const options: SLPKExtractionOptions = parseOptions(validatedOptionsArr);\n\n const validatedOptions: ValidatedSLPKExtractionOptions = validateOptions(options);\n\n await convert(validatedOptions);\n}\n\nmain().catch((error) => {\n console.log(error);\n process.exit(1); // eslint-disable-line\n});\n\n/**\n * Output for `npx slpk-extractor --help`\n */\nfunction printHelp(): void {\n console.log('cli: converter slpk to I3S...');\n console.log('--output [Output folder, default: \"data\" folder]');\n console.log('--tileset [SLPK file]');\n process.exit(0); // eslint-disable-line\n}\n\n/**\n * Run extraction process\n * @param options validated slpk-extractor options\n */\nasync function convert(options: ValidatedSLPKExtractionOptions) {\n console.log(`------------------------------------------------`); // eslint-disable-line\n console.log(`Starting conversion of SLPK`); // eslint-disable-line\n console.log(`------------------------------------------------`); // eslint-disable-line\n const slpkExtractor = new SLPKExtractor();\n slpkExtractor.extract({\n inputUrl: options.tileset,\n outputPath: options.output\n });\n}\n\n// OPTIONS\n/**\n * Validate input options of the CLI command\n * @param options - input options of the CLI command\n * @returns validated options\n */\nfunction validateOptions(options: SLPKExtractionOptions): ValidatedSLPKExtractionOptions {\n const mandatoryOptionsWithExceptions: {\n [key: string]: () => void;\n } = {\n output: () => console.log('Missed: --output [Output path name]'),\n tileset: () => console.log('Missed: --tileset [SLPK file]')\n };\n const exceptions: (() => void)[] = [];\n for (const mandatoryOption in mandatoryOptionsWithExceptions) {\n const optionValue = options[mandatoryOption];\n if (!optionValue) {\n exceptions.push(mandatoryOptionsWithExceptions[mandatoryOption]);\n }\n }\n if (exceptions.length) {\n exceptions.forEach((exeption) => exeption());\n process.exit(1);\n }\n return <ValidatedSLPKExtractionOptions>options;\n}\n\n/**\n * Parse option from the cli arguments array\n * @param args\n * @returns\n */\nfunction parseOptions(args: string[]): SLPKExtractionOptions {\n const opts: SLPKExtractionOptions = {};\n\n // eslint-disable-next-line complexity\n args.forEach((arg, index) => {\n if (arg.indexOf('--') === 0) {\n switch (arg) {\n case '--tileset':\n opts.tileset = getURLValue(index, args);\n break;\n case '--output':\n opts.output = getURLValue(index, args);\n break;\n case '--help':\n printHelp();\n break;\n default:\n console.warn(`Unknown option ${arg}`);\n process.exit(0); // eslint-disable-line\n }\n }\n });\n return opts;\n}\n"],"mappings":"AACA,OAAO,uB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;EACF,OAAOc,IAAI;AACb"}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { GLTFAccessorPostprocessed, GLTFMeshPrimitivePostprocessed } from '@loaders.gl/gltf';
|
|
2
2
|
import type { NumericArray } from '@loaders.gl/loader-utils';
|
|
3
|
-
import { TextureImageProperties } from '
|
|
3
|
+
import { TextureImageProperties } from '../types';
|
|
4
|
+
import { Tiles3DTileContent } from '@loaders.gl/3d-tiles';
|
|
5
|
+
/**
|
|
6
|
+
* Get featureTexture by a metadata class.
|
|
7
|
+
* Metadata classes come from a structural metadata extesion (EXT_feature_metadata or EXT_structural_metadata).
|
|
8
|
+
* The glTF might contain multiple texel-level metadata textures related to different classes. Having only one metadata class
|
|
9
|
+
* selected to convert to I3S, we have to pick only one texture to convert to per-vertex property.
|
|
10
|
+
* @param tileContent - 3d tile content
|
|
11
|
+
* @param metadataClass - user selected feature metadata class name
|
|
12
|
+
* @returns featureTexture key
|
|
13
|
+
*/
|
|
14
|
+
export declare function getTextureByMetadataClass(tileContent: Tiles3DTileContent, metadataClass?: string): string | null;
|
|
4
15
|
/**
|
|
5
16
|
* Getting batchIds from 3DTilesNext extensions.
|
|
6
17
|
* @param attributes - gltf accessors
|
|
7
18
|
* @param primitive - gltf primitive data
|
|
8
19
|
* @param images - gltf texture images
|
|
20
|
+
* @param featureTexture - feature texture key
|
|
21
|
+
* @return array of batch IDs
|
|
9
22
|
*/
|
|
10
23
|
export declare function handleBatchIdsExtensions(attributes: {
|
|
11
24
|
[key: string]: GLTFAccessorPostprocessed;
|
|
12
|
-
}, primitive: GLTFMeshPrimitivePostprocessed, images: (TextureImageProperties | null)[]): NumericArray;
|
|
25
|
+
}, primitive: GLTFMeshPrimitivePostprocessed, images: (TextureImageProperties | null)[], featureTexture: string | null): NumericArray;
|
|
13
26
|
//# sourceMappingURL=batch-ids-extensions.d.ts.map
|
|
@@ -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;AAU3D,OAAO,EAAC,sBAAsB,EAAC,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD;;;;;;;;GAQG;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,CAuBd"}
|
|
@@ -26,7 +26,6 @@ export declare function createBoundingVolumesFromGeometry(cartesianPositions: Fl
|
|
|
26
26
|
export declare function convertPositionsToVectors(positions: Float32Array): Vector3[];
|
|
27
27
|
/**
|
|
28
28
|
* Convert common coordinate to fullExtent https://github.com/Esri/i3s-spec/blob/master/docs/1.8/fullExtent.cmn.md
|
|
29
|
-
* @param
|
|
30
29
|
* @param boundingVolume
|
|
31
30
|
* @returns - fullExtent object
|
|
32
31
|
*/
|
|
@@ -34,7 +33,7 @@ export declare function convertBoundingVolumeToI3SFullExtent(boundingVolume: Ori
|
|
|
34
33
|
/**
|
|
35
34
|
* Creates oriented boundinb box from mbs.
|
|
36
35
|
* @param mbs - Minimum Bounding Sphere
|
|
37
|
-
* @returns - Oriented
|
|
36
|
+
* @returns - Oriented Bounding Box
|
|
38
37
|
*/
|
|
39
38
|
export declare function createObbFromMbs(mbs: Mbs): Obb;
|
|
40
39
|
//# sourceMappingURL=coordinate-converter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinate-converter.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/coordinate-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAE3E,OAAO,EAAsB,OAAO,EAAC,MAAM,eAAe,CAAC;AAE3D,OAAO,EACL,mBAAmB,EAGnB,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,mBAAmB,GAAG,cAAc,EAC1D,gBAAgB,EAAE,KAAK,GACtB,eAAe,CAgCjB;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,kBAAkB,EAAE,YAAY,EAChC,gBAAgB,EAAE,KAAK,GACtB;IAAC,GAAG,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAC,CAoBtB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO,EAAE,CAW5E;AAED
|
|
1
|
+
{"version":3,"file":"coordinate-converter.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/coordinate-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAE3E,OAAO,EAAsB,OAAO,EAAC,MAAM,eAAe,CAAC;AAE3D,OAAO,EACL,mBAAmB,EAGnB,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,mBAAmB,GAAG,cAAc,EAC1D,gBAAgB,EAAE,KAAK,GACtB,eAAe,CAgCjB;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,kBAAkB,EAAE,YAAY,EAChC,gBAAgB,EAAE,KAAK,GACtB;IAAC,GAAG,EAAE,GAAG,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAC,CAoBtB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO,EAAE,CAW5E;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,cAAc,EAAE,mBAAmB,GAAG,cAAc,GACnD,UAAU,CA4BZ;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAK9C"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { FeatureTableJson } from '@loaders.gl/3d-tiles';
|
|
2
2
|
import { Attribute, AttributeStorageInfo, ESRIField, Field, PopupInfo } from '@loaders.gl/i3s';
|
|
3
3
|
/**
|
|
4
|
-
* Takes attributes from property table based on
|
|
4
|
+
* Takes attributes from property table based on featureIdsMap.
|
|
5
5
|
* If there is no property value for particular featureId (index) the property will be null.
|
|
6
6
|
* Example:
|
|
7
7
|
* Initial data:
|
|
8
|
-
* OBJECTID:
|
|
8
|
+
* OBJECTID: {0: 0, 3: 33, 4: 333}
|
|
9
9
|
* component: ['Windows', 'Frames', 'Wall', 'Roof', 'Skylight']
|
|
10
10
|
* Result:
|
|
11
|
-
* OBJECTID: [0,
|
|
12
|
-
* component: ['Windows', '
|
|
13
|
-
* @param
|
|
11
|
+
* OBJECTID: [0, 33, 333]
|
|
12
|
+
* component: ['Windows', 'Roof', 'Skylight']
|
|
13
|
+
* @param featureIdsMap
|
|
14
14
|
* @param propertyTable
|
|
15
15
|
*/
|
|
16
|
-
export declare function flattenPropertyTableByFeatureIds(
|
|
16
|
+
export declare function flattenPropertyTableByFeatureIds(featureIdsMap: Record<string, number>, propertyTable: FeatureTableJson): FeatureTableJson;
|
|
17
17
|
/**
|
|
18
18
|
* Check that all attributes in propertyTable have the same length as FeatureIds.
|
|
19
19
|
* If there are differencies between lengths we should flatten property table based on exiesting featureIds.
|
|
@@ -25,9 +25,9 @@ export declare function checkPropertiesLength(featureIds: number[], propertyTabl
|
|
|
25
25
|
/**
|
|
26
26
|
* Get the attribute type for attributeStorageInfo https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md
|
|
27
27
|
* @param key - attribute's key
|
|
28
|
-
* @param attribute - attribute
|
|
28
|
+
* @param attribute - attribute taken from propertyTable
|
|
29
29
|
*/
|
|
30
|
-
export declare function getAttributeType(key: string, attribute:
|
|
30
|
+
export declare function getAttributeType(key: string, attribute: unknown): string;
|
|
31
31
|
/**
|
|
32
32
|
* Generate storage attribute for map segmentation.
|
|
33
33
|
* @param attributeIndex - order index of attribute (f_0, f_1 ...).
|
|
@@ -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,
|
|
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,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,aAAa,EAAE,gBAAgB,GAC9B,gBAAgB,CAQlB;AAuBD;;;;;;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,OAAO,GAAG,MAAM,CAUxE;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry-attributes.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/geometry-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"geometry-attributes.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/geometry-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EAGpB,MAAM,UAAU,CAAC;AAMlB;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,GAAG,kBAAkB,CAyBtF"}
|
|
@@ -3,8 +3,7 @@ import { Matrix4 } from '@math.gl/core';
|
|
|
3
3
|
import { ConvertedAttributes, I3SConvertedResources, I3SMaterialWithTexture } from '../types';
|
|
4
4
|
import { AttributeStorageInfo } from '@loaders.gl/i3s';
|
|
5
5
|
import { Geoid } from '@math.gl/geoid';
|
|
6
|
-
|
|
7
|
-
import { B3DMAttributesData } from '../../i3s-attributes-worker';
|
|
6
|
+
import type { GLTFAttributesData } from '../types';
|
|
8
7
|
import { BoundingSphere, OrientedBoundingBox } from '@math.gl/culling';
|
|
9
8
|
/**
|
|
10
9
|
* Convert binary data from b3dm file to i3s resources
|
|
@@ -21,26 +20,27 @@ import { BoundingSphere, OrientedBoundingBox } from '@math.gl/culling';
|
|
|
21
20
|
* @param generateBoundingVolumes - is converter should create accurate bounding voulmes from geometry attributes
|
|
22
21
|
* @param shouldMergeMaterials - Try to merge similar materials to be able to merge meshes into one node
|
|
23
22
|
* @param geoidHeightModel - model to convert elevation from elipsoidal to geoid
|
|
24
|
-
* @param
|
|
23
|
+
* @param libraries - dynamicaly loaded 3rd-party libraries
|
|
24
|
+
* @param metadataClass `- user selected feature metadata class name`
|
|
25
25
|
* @returns Array of node resources to create one or more i3s nodes
|
|
26
26
|
*/
|
|
27
|
-
export default function convertB3dmToI3sGeometry(tileContent: Tiles3DTileContent, tileTransform: Matrix4, tileBoundingVolume: OrientedBoundingBox | BoundingSphere, addNodeToNodePage: () => Promise<number>, propertyTable: FeatureTableJson | null, featuresHashArray: string[], attributeStorageInfo: AttributeStorageInfo[] | undefined, draco: boolean, generateBoundingVolumes: boolean, shouldMergeMaterials: boolean, geoidHeightModel: Geoid,
|
|
28
|
-
[key: string]: string;
|
|
29
|
-
}): Promise<I3SConvertedResources[] | null>;
|
|
27
|
+
export default function convertB3dmToI3sGeometry(tileContent: Tiles3DTileContent, tileTransform: Matrix4, tileBoundingVolume: OrientedBoundingBox | BoundingSphere, addNodeToNodePage: () => Promise<number>, propertyTable: FeatureTableJson | null, featuresHashArray: string[], attributeStorageInfo: AttributeStorageInfo[] | undefined, draco: boolean, generateBoundingVolumes: boolean, shouldMergeMaterials: boolean, geoidHeightModel: Geoid, libraries: Record<string, string>, metadataClass?: string): Promise<I3SConvertedResources[] | null>;
|
|
30
28
|
/**
|
|
31
29
|
* Convert attributes from the gltf nodes tree to i3s plain geometry
|
|
32
30
|
* @param attributesData - geometry attributes from gltf
|
|
33
31
|
* @param materialAndTextureList - array of data about materials and textures of the content
|
|
34
32
|
* @param useCartesianPositions - convert positions to absolute cartesian coordinates instead of cartographic offsets.
|
|
35
33
|
* Cartesian coordinates will be required for creating bounding voulmest from geometry positions
|
|
34
|
+
* @param featureTexture - feature texture key
|
|
36
35
|
* @returns map of converted geometry attributes
|
|
37
36
|
*/
|
|
38
|
-
export declare function convertAttributes(attributesData:
|
|
37
|
+
export declare function convertAttributes(attributesData: GLTFAttributesData, materialAndTextureList: I3SMaterialWithTexture[], useCartesianPositions: boolean, featureTexture: string | null): Promise<Map<string, ConvertedAttributes>>;
|
|
39
38
|
/**
|
|
40
39
|
* Find property table in tile
|
|
41
40
|
* For example it can be batchTable for b3dm files or property table in gLTF extension.
|
|
42
41
|
* @param tileContent - 3DTiles tile content
|
|
43
|
-
* @
|
|
42
|
+
* @param metadataClass - user selected feature metadata class name
|
|
43
|
+
* @return batch table from b3dm / feature properties from EXT_FEATURE_METADATA or EXT_STRUCTURAL_METADATA.
|
|
44
44
|
*/
|
|
45
|
-
export declare function getPropertyTable(tileContent: Tiles3DTileContent | null): FeatureTableJson | null;
|
|
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;AAY/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;
|
|
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;AAY/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;AA8BrE;;;;;;;;;;;;;;;;;;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;AAoJD;;;;;;;;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;AAmsCD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,kBAAkB,GAAG,IAAI,EACtC,aAAa,CAAC,EAAE,MAAM,GACrB,gBAAgB,GAAG,IAAI,CA+BzB"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Tiles3DTileContent } from '@loaders.gl/3d-tiles';
|
|
2
|
-
import type { B3DMAttributesData } from '../../i3s-attributes-worker';
|
|
3
2
|
import { Matrix4, Vector3 } from '@math.gl/core';
|
|
4
3
|
import { BoundingSphere, OrientedBoundingBox } from '@math.gl/culling';
|
|
4
|
+
import { GLTFAttributesData } from '../types';
|
|
5
5
|
/**
|
|
6
6
|
* Prepare attributes for conversion to avoid binary data breaking in worker thread.
|
|
7
7
|
* @param tileContent - 3DTiles tile content
|
|
8
8
|
* @param tileTransform - transformation matrix of the tile, calculated recursively multiplying
|
|
9
9
|
* transform of all parent tiles and transform of the current tile
|
|
10
10
|
* @param boundingVolume - initialized bounding volume of the source tile
|
|
11
|
-
* @returns
|
|
11
|
+
* @returns 3DTiles content data, prepared for conversion
|
|
12
12
|
*/
|
|
13
|
-
export declare function prepareDataForAttributesConversion(tileContent: Tiles3DTileContent, tileTransform: Matrix4, boundingVolume: OrientedBoundingBox | BoundingSphere):
|
|
13
|
+
export declare function prepareDataForAttributesConversion(tileContent: Tiles3DTileContent, tileTransform: Matrix4, boundingVolume: OrientedBoundingBox | BoundingSphere): GLTFAttributesData;
|
|
14
14
|
/**
|
|
15
15
|
* Calculate transformation properties to transform vertex attributes (POSITION, NORMAL, etc.)
|
|
16
16
|
* from METER_OFFSET coorditantes to LNGLAT_OFFSET coordinates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gltf-attributes.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/gltf-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAE7D,OAAO,
|
|
1
|
+
{"version":3,"file":"gltf-attributes.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/gltf-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAC,OAAO,EAAc,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAErE,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,kBAAkB,EAC/B,aAAa,EAAE,OAAO,EACtB,cAAc,EAAE,mBAAmB,GAAG,cAAc,GACnD,kBAAkB,CAyCpB;AAqBD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,kBAAkB,EAC/B,aAAa,EAAE,OAAO,EACtB,cAAc,EAAE,mBAAmB,GAAG,cAAc,GACnD;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,kBAAkB,EAAE,OAAO,CAAA;CAAC,CAkCrD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Tiles3DLoaderOptions, Tiles3DTileContent, Tiles3DTileJSONPostprocessed, Tiles3DTilesetJSONPostprocessed } from '@loaders.gl/3d-tiles';
|
|
2
|
+
import { LoaderWithParser } from '@loaders.gl/core';
|
|
2
3
|
/**
|
|
3
4
|
* Load nested 3DTiles tileset. If the sourceTile is not nested tileset - do nothing
|
|
4
5
|
* @param sourceTileset - source root tileset JSON
|
|
@@ -15,4 +16,18 @@ export declare const loadNestedTileset: (sourceTileset: Tiles3DTilesetJSONPostpr
|
|
|
15
16
|
* @returns - 3DTiles tile content or null
|
|
16
17
|
*/
|
|
17
18
|
export declare const loadTile3DContent: (sourceTileset: Tiles3DTilesetJSONPostprocessed | null, sourceTile: Tiles3DTileJSONPostprocessed, tilesetLoadOptions: Tiles3DLoaderOptions) => Promise<Tiles3DTileContent | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Load a resource with load options and .3tz format support
|
|
21
|
+
* @param url - resource URL
|
|
22
|
+
* @param loader - loader to parse data (Tiles3DLoader / CesiumIonLoader)
|
|
23
|
+
* @param loadOptions - 3d-tiles loader options
|
|
24
|
+
* @returns 3d-tiles resource
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadFromArchive(url: string, loader: LoaderWithParser, loadOptions: Tiles3DLoaderOptions): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Check if tile is nested tileset
|
|
29
|
+
* @param tile - 3DTiles header data
|
|
30
|
+
* @returns true if tile is nested tileset
|
|
31
|
+
*/
|
|
32
|
+
export declare function isNestedTileset(tile: Tiles3DTileJSONPostprocessed): boolean;
|
|
18
33
|
//# sourceMappingURL=load-3d-tiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-3d-tiles.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/load-3d-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"load-3d-tiles.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/load-3d-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAC,gBAAgB,EAAO,MAAM,kBAAkB,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kBACb,+BAA+B,GAAG,IAAI,cACzC,4BAA4B,sBACpB,oBAAoB,KACvC,QAAQ,IAAI,CAsBd,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kBACb,+BAA+B,GAAG,IAAI,cACzC,4BAA4B,sBACpB,oBAAoB,KACvC,QAAQ,kBAAkB,GAAG,IAAI,CAqBnC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,oBAAoB,gBA0BlC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,4BAA4B,WAEjE"}
|
|
@@ -1 +1 @@
|
|
|
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,EAA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B,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"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { Tiles3DTileContent
|
|
2
|
-
import {
|
|
1
|
+
import { Tiles3DTileContent } from '@loaders.gl/3d-tiles';
|
|
2
|
+
import { GLTFPrimitiveModeString, PreprocessData } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* glTF primitive modes
|
|
5
5
|
* @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode
|
|
6
6
|
*/
|
|
7
|
-
export declare const GLTF_PRIMITIVE_MODES:
|
|
7
|
+
export declare const GLTF_PRIMITIVE_MODES: GLTFPrimitiveModeString[];
|
|
8
8
|
/**
|
|
9
9
|
* Analyze tile content. This function is used during preprocess stage of
|
|
10
10
|
* conversion
|
|
11
|
-
* @param tile - 3DTiles tile JSON metadata
|
|
12
11
|
* @param tileContent - 3DTiles tile content ArrayBuffer
|
|
13
12
|
* @returns
|
|
14
13
|
*/
|
|
15
|
-
export declare const analyzeTileContent: (
|
|
14
|
+
export declare const analyzeTileContent: (tileContent: Tiles3DTileContent | null) => Promise<PreprocessData>;
|
|
16
15
|
/**
|
|
17
16
|
* Merge object2 into object1
|
|
18
17
|
* @param object1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preprocess-3d-tiles.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/preprocess-3d-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,
|
|
1
|
+
{"version":3,"file":"preprocess-3d-tiles.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/preprocess-3d-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAE,cAAc,EAAC,MAAM,UAAU,CAAC;AAWjE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,2BAQhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,gBAChB,kBAAkB,GAAG,IAAI,KACrC,QAAQ,cAAc,CAuBxB,CAAC;AAwDF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,YAAa,cAAc,WAAW,cAAc,KAAG,IAUtF,CAAC"}
|
|
@@ -78,6 +78,8 @@ export default class I3SConverter {
|
|
|
78
78
|
generateTextures?: boolean;
|
|
79
79
|
generateBoundingVolumes?: boolean;
|
|
80
80
|
instantNodeWriting?: boolean;
|
|
81
|
+
inquirer?: Promise<unknown>;
|
|
82
|
+
metadataClass?: string;
|
|
81
83
|
}): Promise<string>;
|
|
82
84
|
/**
|
|
83
85
|
* Preprocess stage of the tile converter. Traverse all the tiles tree and
|
|
@@ -145,7 +147,7 @@ export default class I3SConverter {
|
|
|
145
147
|
* @param boundingVolume - initialized bounding volume of the source tile
|
|
146
148
|
* @param tileContent - content of the source tile
|
|
147
149
|
* @param parentId - id of parent node in node pages
|
|
148
|
-
* @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
|
|
149
151
|
* @returns - converted node resources
|
|
150
152
|
*/
|
|
151
153
|
private _convertResources;
|
|
@@ -262,6 +264,5 @@ export default class I3SConverter {
|
|
|
262
264
|
* @returns
|
|
263
265
|
*/
|
|
264
266
|
private isContentSupported;
|
|
265
|
-
private loadWorkers;
|
|
266
267
|
}
|
|
267
268
|
//# sourceMappingURL=i3s-converter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,oBAAoB,EAGpB,+BAA+B,EAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,oBAAoB,EAGpB,+BAA+B,EAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EAKb,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAOrC,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAuB7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,qBAAqB,EAA8B,MAAM,iBAAiB,CAAC;AAGnF,OAAO,EAGL,cAAc,EAEf,MAAM,SAAS,CAAC;AAEjB,OAAO,UAAU,MAAM,0BAA0B,CAAC;AA8BlD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,SAAS,EA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AC,oBAAoB;IAa5B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAU7B;;;;;;OAMG;IACH,OAAO,CAAC,8BAA8B;IAWtC;;;OAGG;IACH,OAAO,CAAC,qCAAqC;IAoC7C;;;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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { GLTFImagePostprocessed } from '@loaders.gl/gltf';
|
|
1
|
+
import { GLTFImagePostprocessed, GLTFNodePostprocessed } from '@loaders.gl/gltf';
|
|
2
2
|
import { BoundingVolumes, I3SMaterialDefinition, MaterialDefinitionInfo, TextureDefinitionInfo } from '@loaders.gl/i3s';
|
|
3
|
+
import { Matrix4, Vector3 } from '@math.gl/core';
|
|
3
4
|
/** Converted resources for specific node */
|
|
4
5
|
export type I3SConvertedResources = {
|
|
5
6
|
/**
|
|
@@ -96,10 +97,8 @@ export type GeometryAttributes = {
|
|
|
96
97
|
/** number of features in the node */
|
|
97
98
|
featureCount: number;
|
|
98
99
|
};
|
|
99
|
-
/** Geometry attributes
|
|
100
|
-
export type
|
|
101
|
-
/** Feature Id */
|
|
102
|
-
featureId: number;
|
|
100
|
+
/** Geometry attributes applicable for reordering by featureId */
|
|
101
|
+
export type GroupedAttributes = {
|
|
103
102
|
/** POSITION attribute value */
|
|
104
103
|
positions: Float32Array;
|
|
105
104
|
/** NORMAL attribute value */
|
|
@@ -111,6 +110,11 @@ export type GroupedByFeatureIdAttributes = {
|
|
|
111
110
|
/** TEXCOORD_0 attribute value */
|
|
112
111
|
texCoords: Float32Array;
|
|
113
112
|
};
|
|
113
|
+
/** Geometry attributes specific for the particular feature */
|
|
114
|
+
export type GroupedByFeatureIdAttributes = GroupedAttributes & {
|
|
115
|
+
/** Feature Id */
|
|
116
|
+
featureId: number;
|
|
117
|
+
};
|
|
114
118
|
/** Shared resources made from GLTF material */
|
|
115
119
|
export type SharedResourcesArrays = {
|
|
116
120
|
/** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */
|
|
@@ -146,7 +150,7 @@ export type TypedArrayConstructor = Uint8ArrayConstructor | Int8ArrayConstructor
|
|
|
146
150
|
* glTF primitive modes (mesh topology types)
|
|
147
151
|
* @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode
|
|
148
152
|
*/
|
|
149
|
-
export declare enum
|
|
153
|
+
export declare enum GLTFPrimitiveModeString {
|
|
150
154
|
POINTS = "POINTS",
|
|
151
155
|
LINES = "LINES",
|
|
152
156
|
LINE_LOOP = "LINE_LOOP",
|
|
@@ -158,6 +162,43 @@ export declare enum GltfPrimitiveModeString {
|
|
|
158
162
|
/** Preprocessed data gathered from child tiles binary content */
|
|
159
163
|
export type PreprocessData = {
|
|
160
164
|
/** Mesh topology types used in gltf primitives of the tileset */
|
|
161
|
-
meshTopologyTypes: Set<
|
|
165
|
+
meshTopologyTypes: Set<GLTFPrimitiveModeString>;
|
|
166
|
+
/**
|
|
167
|
+
* Featrue metadata classes found in glTF extensions
|
|
168
|
+
* The tileset might contain multiple metadata classes provided by EXT_feature_metadata and EXT_structural_metadata extensions.
|
|
169
|
+
* Every class is a set of properties. But I3S can consume only one set of properties.
|
|
170
|
+
* On the pre-process we collect all classes from the tileset in order to show the prompt to select one class for conversion to I3S.
|
|
171
|
+
*/
|
|
172
|
+
metadataClasses: Set<string>;
|
|
173
|
+
};
|
|
174
|
+
/** Texture image properties required for conversion */
|
|
175
|
+
export type TextureImageProperties = {
|
|
176
|
+
/** Array with image data */
|
|
177
|
+
data: Uint8Array;
|
|
178
|
+
/** Is the texture compressed */
|
|
179
|
+
compressed?: boolean;
|
|
180
|
+
/** Height of the texture's image */
|
|
181
|
+
height?: number;
|
|
182
|
+
/** Width of the texture's image */
|
|
183
|
+
width?: number;
|
|
184
|
+
/** Number of components (3 for RGB, 4 for RGBA) */
|
|
185
|
+
components?: number;
|
|
186
|
+
/** Mime type of the texture's image */
|
|
187
|
+
mimeType?: string;
|
|
188
|
+
};
|
|
189
|
+
/** glTF attributes data, prepared for conversion */
|
|
190
|
+
export type GLTFAttributesData = {
|
|
191
|
+
/** glTF PBR materials (only id is required) */
|
|
192
|
+
gltfMaterials?: {
|
|
193
|
+
id: string;
|
|
194
|
+
}[];
|
|
195
|
+
/** glTF geometry nodes */
|
|
196
|
+
nodes: GLTFNodePostprocessed[];
|
|
197
|
+
/** glTF texture images (set to null for compressed textures) */
|
|
198
|
+
images: (null | TextureImageProperties)[];
|
|
199
|
+
/** Source tile origin coordinates in cartographic coordinate system */
|
|
200
|
+
cartographicOrigin: Vector3;
|
|
201
|
+
/** Model matrix to convert coordinate system of POSITION and NORMAL attributes from METER_OFFSETS to CARTESIAN */
|
|
202
|
+
cartesianModelMatrix: Matrix4;
|
|
162
203
|
};
|
|
163
204
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,eAAe,CAAC;AAE/C,4CAA4C;AAC5C,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;I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,gEAAgE;IAChE,MAAM,EAAE,CAAC,IAAI,GAAG,sBAAsB,CAAC,EAAE,CAAC;IAC1C,uEAAuE;IACvE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,mHAAmH;IACnH,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAAC"}
|
package/dist/i3s-server/app.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/i3s-server/app.
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/i3s-server/app.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,GAAG,6CAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"www.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/bin/www.ts"],"names":[],"mappings":""}
|