@loaders.gl/tile-converter 4.3.0-alpha.1 → 4.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/converter.min.cjs +105 -96
- package/dist/deps-installer/deps-installer.js +1 -1
- package/dist/i3s-server/app.js +7 -1
- package/dist/i3s-server/bin/i3s-server.min.cjs +100 -91
- package/dist/i3s-server/controllers/index-controller.d.ts +2 -1
- package/dist/i3s-server/controllers/index-controller.d.ts.map +1 -1
- package/dist/i3s-server/controllers/index-controller.js +11 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/pgm-loader.js +1 -1
- package/dist/slpk-extractor.min.cjs +73 -64
- package/package.json +16 -16
- package/src/i3s-converter/helpers/load-3d-tiles.ts +2 -2
- package/src/i3s-server/app.ts +7 -1
- package/src/i3s-server/controllers/index-controller.ts +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tile-converter",
|
|
3
|
-
"version": "4.3.0-alpha.
|
|
3
|
+
"version": "4.3.0-alpha.3",
|
|
4
4
|
"description": "Converter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"copy-certificates": "cp -R src/i3s-server/certs dist/i3s-server"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@loaders.gl/3d-tiles": "4.3.0-alpha.
|
|
57
|
-
"@loaders.gl/compression": "4.3.0-alpha.
|
|
58
|
-
"@loaders.gl/crypto": "4.3.0-alpha.
|
|
59
|
-
"@loaders.gl/draco": "4.3.0-alpha.
|
|
60
|
-
"@loaders.gl/gltf": "4.3.0-alpha.
|
|
61
|
-
"@loaders.gl/i3s": "4.3.0-alpha.
|
|
62
|
-
"@loaders.gl/images": "4.3.0-alpha.
|
|
63
|
-
"@loaders.gl/loader-utils": "4.3.0-alpha.
|
|
64
|
-
"@loaders.gl/math": "4.3.0-alpha.
|
|
65
|
-
"@loaders.gl/polyfills": "4.3.0-alpha.
|
|
66
|
-
"@loaders.gl/textures": "4.3.0-alpha.
|
|
67
|
-
"@loaders.gl/tiles": "4.3.0-alpha.
|
|
68
|
-
"@loaders.gl/worker-utils": "4.3.0-alpha.
|
|
69
|
-
"@loaders.gl/zip": "4.3.0-alpha.
|
|
56
|
+
"@loaders.gl/3d-tiles": "4.3.0-alpha.3",
|
|
57
|
+
"@loaders.gl/compression": "4.3.0-alpha.3",
|
|
58
|
+
"@loaders.gl/crypto": "4.3.0-alpha.3",
|
|
59
|
+
"@loaders.gl/draco": "4.3.0-alpha.3",
|
|
60
|
+
"@loaders.gl/gltf": "4.3.0-alpha.3",
|
|
61
|
+
"@loaders.gl/i3s": "4.3.0-alpha.3",
|
|
62
|
+
"@loaders.gl/images": "4.3.0-alpha.3",
|
|
63
|
+
"@loaders.gl/loader-utils": "4.3.0-alpha.3",
|
|
64
|
+
"@loaders.gl/math": "4.3.0-alpha.3",
|
|
65
|
+
"@loaders.gl/polyfills": "4.3.0-alpha.3",
|
|
66
|
+
"@loaders.gl/textures": "4.3.0-alpha.3",
|
|
67
|
+
"@loaders.gl/tiles": "4.3.0-alpha.3",
|
|
68
|
+
"@loaders.gl/worker-utils": "4.3.0-alpha.3",
|
|
69
|
+
"@loaders.gl/zip": "4.3.0-alpha.3",
|
|
70
70
|
"@math.gl/core": "^4.0.0",
|
|
71
71
|
"@math.gl/culling": "^4.0.0",
|
|
72
72
|
"@math.gl/geoid": "^4.0.0",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"peerDependencies": {
|
|
95
95
|
"@loaders.gl/core": "^4.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "3213679d79e6ff2814d48fd3337acfa446c74099"
|
|
98
98
|
}
|
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
} from '@loaders.gl/3d-tiles';
|
|
7
7
|
import {Tiles3DArchive} from '@loaders.gl/3d-tiles';
|
|
8
8
|
import {LoaderWithParser, load} from '@loaders.gl/core';
|
|
9
|
-
import {FileHandleFile,
|
|
9
|
+
import {FileHandleFile, FileProviderInterface} from '@loaders.gl/loader-utils';
|
|
10
10
|
import {
|
|
11
11
|
CD_HEADER_SIGNATURE,
|
|
12
12
|
ZipFileSystem,
|
|
@@ -142,7 +142,7 @@ export function isNestedTileset(tile: Tiles3DTileJSONPostprocessed) {
|
|
|
142
142
|
* @returns hash table of the 3TZ file content or undefined if the hash file is not presented inside
|
|
143
143
|
*/
|
|
144
144
|
async function loadHashTable(
|
|
145
|
-
fileProvider:
|
|
145
|
+
fileProvider: FileProviderInterface
|
|
146
146
|
): Promise<undefined | Record<string, bigint>> {
|
|
147
147
|
let hashTable: undefined | Record<string, bigint>;
|
|
148
148
|
|
package/src/i3s-server/app.ts
CHANGED
|
@@ -24,7 +24,13 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|
|
24
24
|
app.use(cors());
|
|
25
25
|
|
|
26
26
|
if (/\.slpk$/.test(I3S_LAYER_PATH)) {
|
|
27
|
-
|
|
27
|
+
let filePath = FULL_LAYER_PATH;
|
|
28
|
+
// Checks if the first character is not a point to indicate absolute path
|
|
29
|
+
const absolutePath = /^[^.]/.exec(I3S_LAYER_PATH);
|
|
30
|
+
if (absolutePath) {
|
|
31
|
+
filePath = I3S_LAYER_PATH;
|
|
32
|
+
}
|
|
33
|
+
loadArchive(filePath);
|
|
28
34
|
app.use('/SceneServer/layers/0', router);
|
|
29
35
|
app.use('/SceneServer', sceneServerRouter);
|
|
30
36
|
} else {
|
|
@@ -3,18 +3,24 @@ import fs from 'fs';
|
|
|
3
3
|
|
|
4
4
|
const {promises} = fs;
|
|
5
5
|
|
|
6
|
-
const I3S_LAYER_PATH = process.env.I3sLayerPath || '';
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* Get local file name by input HTTP URL
|
|
10
8
|
* @param url - I3S HTTP service url
|
|
9
|
+
* @param i3sLayerPath - I3S layer path
|
|
11
10
|
* @returns - local file name
|
|
12
11
|
*/
|
|
13
|
-
export async function getFileNameByUrl(url: string): Promise<string | null> {
|
|
12
|
+
export async function getFileNameByUrl(url: string, i3sLayerPath = ''): Promise<string | null> {
|
|
13
|
+
i3sLayerPath = i3sLayerPath || process.env.I3sLayerPath || '';
|
|
14
14
|
const extensions = ['json', 'bin', 'jpg', 'jpeg', 'png', 'bin.dds', 'ktx2'];
|
|
15
|
-
|
|
15
|
+
let filePath = process.cwd();
|
|
16
|
+
// Checks if the first character is not a point to indicate absolute path
|
|
17
|
+
const absolutePath = /^[^.]/.exec(i3sLayerPath);
|
|
18
|
+
if (absolutePath) {
|
|
19
|
+
filePath = '';
|
|
20
|
+
}
|
|
21
|
+
const FULL_LAYER_PATH = path.join(filePath, i3sLayerPath, url);
|
|
16
22
|
for (const ext of extensions) {
|
|
17
|
-
const fileName = `${FULL_LAYER_PATH}
|
|
23
|
+
const fileName = `${FULL_LAYER_PATH}/index.${ext}`;
|
|
18
24
|
try {
|
|
19
25
|
await promises.access(fileName);
|
|
20
26
|
return fileName;
|