@loaders.gl/tile-converter 4.4.0-alpha.1 → 4.4.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/converter.min.cjs +89 -98
  2. package/dist/i3s-server/bin/i3s-server.min.cjs +78 -78
  3. package/package.json +17 -17
  4. package/src/3d-tiles-converter/3d-tiles-converter.ts +11 -7
  5. package/src/3d-tiles-converter/helpers/load-i3s.ts +5 -5
  6. package/src/converter-cli.ts +2 -2
  7. package/src/i3s-converter/helpers/geometry-converter.ts +17 -1
  8. package/src/i3s-converter/helpers/load-3d-tiles.ts +24 -9
  9. package/src/i3s-converter/i3s-converter.ts +25 -9
  10. package/src/i3s-server/controllers/slpk-controller.ts +2 -2
  11. package/src/lib/utils/compress-util.ts +1 -0
  12. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +0 -115
  13. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +0 -1
  14. package/dist/3d-tiles-converter/3d-tiles-converter.js +0 -388
  15. package/dist/3d-tiles-converter/helpers/3d-tiles-content-converter.d.ts +0 -88
  16. package/dist/3d-tiles-converter/helpers/3d-tiles-content-converter.d.ts.map +0 -1
  17. package/dist/3d-tiles-converter/helpers/3d-tiles-content-converter.js +0 -380
  18. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts +0 -13
  19. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.d.ts.map +0 -1
  20. package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -19
  21. package/dist/3d-tiles-converter/helpers/load-i3s.d.ts +0 -37
  22. package/dist/3d-tiles-converter/helpers/load-i3s.d.ts.map +0 -1
  23. package/dist/3d-tiles-converter/helpers/load-i3s.js +0 -98
  24. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts +0 -10
  25. package/dist/3d-tiles-converter/helpers/texture-atlas.d.ts.map +0 -1
  26. package/dist/3d-tiles-converter/helpers/texture-atlas.js +0 -50
  27. package/dist/3d-tiles-converter/json-templates/tileset.d.ts +0 -15
  28. package/dist/3d-tiles-converter/json-templates/tileset.d.ts.map +0 -1
  29. package/dist/3d-tiles-converter/json-templates/tileset.js +0 -39
  30. package/dist/constants.d.ts +0 -3
  31. package/dist/constants.d.ts.map +0 -1
  32. package/dist/constants.js +0 -2
  33. package/dist/converter-cli.d.ts +0 -2
  34. package/dist/converter-cli.d.ts.map +0 -1
  35. package/dist/converter-cli.js +0 -290
  36. package/dist/deps-installer/deps-installer.d.ts +0 -19
  37. package/dist/deps-installer/deps-installer.d.ts.map +0 -1
  38. package/dist/deps-installer/deps-installer.js +0 -95
  39. package/dist/i3s-converter/helpers/attribute-metadata-info.d.ts +0 -84
  40. package/dist/i3s-converter/helpers/attribute-metadata-info.d.ts.map +0 -1
  41. package/dist/i3s-converter/helpers/attribute-metadata-info.js +0 -219
  42. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +0 -26
  43. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +0 -1
  44. package/dist/i3s-converter/helpers/batch-ids-extensions.js +0 -165
  45. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +0 -39
  46. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +0 -1
  47. package/dist/i3s-converter/helpers/coordinate-converter.js +0 -118
  48. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts +0 -9
  49. package/dist/i3s-converter/helpers/create-scene-server-path.d.ts.map +0 -1
  50. package/dist/i3s-converter/helpers/create-scene-server-path.js +0 -21
  51. package/dist/i3s-converter/helpers/feature-attributes.d.ts +0 -54
  52. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +0 -1
  53. package/dist/i3s-converter/helpers/feature-attributes.js +0 -193
  54. package/dist/i3s-converter/helpers/geometry-attributes.d.ts +0 -8
  55. package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +0 -1
  56. package/dist/i3s-converter/helpers/geometry-attributes.js +0 -226
  57. package/dist/i3s-converter/helpers/geometry-converter.d.ts +0 -60
  58. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +0 -1
  59. package/dist/i3s-converter/helpers/geometry-converter.js +0 -1309
  60. package/dist/i3s-converter/helpers/gltf-attributes.d.ts +0 -28
  61. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +0 -1
  62. package/dist/i3s-converter/helpers/gltf-attributes.js +0 -122
  63. package/dist/i3s-converter/helpers/load-3d-tiles.d.ts +0 -33
  64. package/dist/i3s-converter/helpers/load-3d-tiles.d.ts.map +0 -1
  65. package/dist/i3s-converter/helpers/load-3d-tiles.js +0 -121
  66. package/dist/i3s-converter/helpers/node-debug.d.ts +0 -8
  67. package/dist/i3s-converter/helpers/node-debug.d.ts.map +0 -1
  68. package/dist/i3s-converter/helpers/node-debug.js +0 -116
  69. package/dist/i3s-converter/helpers/node-index-document.d.ts +0 -111
  70. package/dist/i3s-converter/helpers/node-index-document.d.ts.map +0 -1
  71. package/dist/i3s-converter/helpers/node-index-document.js +0 -269
  72. package/dist/i3s-converter/helpers/node-pages.d.ts +0 -156
  73. package/dist/i3s-converter/helpers/node-pages.d.ts.map +0 -1
  74. package/dist/i3s-converter/helpers/node-pages.js +0 -285
  75. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts +0 -22
  76. package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +0 -1
  77. package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +0 -104
  78. package/dist/i3s-converter/helpers/progress.d.ts +0 -90
  79. package/dist/i3s-converter/helpers/progress.d.ts.map +0 -1
  80. package/dist/i3s-converter/helpers/progress.js +0 -148
  81. package/dist/i3s-converter/helpers/tileset-traversal.d.ts +0 -32
  82. package/dist/i3s-converter/helpers/tileset-traversal.d.ts.map +0 -1
  83. package/dist/i3s-converter/helpers/tileset-traversal.js +0 -34
  84. package/dist/i3s-converter/i3s-converter.d.ts +0 -312
  85. package/dist/i3s-converter/i3s-converter.d.ts.map +0 -1
  86. package/dist/i3s-converter/i3s-converter.js +0 -1191
  87. package/dist/i3s-converter/json-templates/geometry-definitions.d.ts +0 -7
  88. package/dist/i3s-converter/json-templates/geometry-definitions.d.ts.map +0 -1
  89. package/dist/i3s-converter/json-templates/geometry-definitions.js +0 -80
  90. package/dist/i3s-converter/json-templates/layers.d.ts +0 -70
  91. package/dist/i3s-converter/json-templates/layers.d.ts.map +0 -1
  92. package/dist/i3s-converter/json-templates/layers.js +0 -132
  93. package/dist/i3s-converter/json-templates/metadata.d.ts +0 -22
  94. package/dist/i3s-converter/json-templates/metadata.d.ts.map +0 -1
  95. package/dist/i3s-converter/json-templates/metadata.js +0 -21
  96. package/dist/i3s-converter/json-templates/node.d.ts +0 -61
  97. package/dist/i3s-converter/json-templates/node.d.ts.map +0 -1
  98. package/dist/i3s-converter/json-templates/node.js +0 -82
  99. package/dist/i3s-converter/json-templates/scene-server.d.ts +0 -28
  100. package/dist/i3s-converter/json-templates/scene-server.d.ts.map +0 -1
  101. package/dist/i3s-converter/json-templates/scene-server.js +0 -27
  102. package/dist/i3s-converter/json-templates/shared-resources.d.ts +0 -14
  103. package/dist/i3s-converter/json-templates/shared-resources.d.ts.map +0 -1
  104. package/dist/i3s-converter/json-templates/shared-resources.js +0 -122
  105. package/dist/i3s-converter/json-templates/store.d.ts +0 -95
  106. package/dist/i3s-converter/json-templates/store.d.ts.map +0 -1
  107. package/dist/i3s-converter/json-templates/store.js +0 -100
  108. package/dist/i3s-converter/types.d.ts +0 -226
  109. package/dist/i3s-converter/types.d.ts.map +0 -1
  110. package/dist/i3s-converter/types.js +0 -37
  111. package/dist/i3s-server/app.d.ts +0 -3
  112. package/dist/i3s-server/app.d.ts.map +0 -1
  113. package/dist/i3s-server/app.js +0 -31
  114. package/dist/i3s-server/bin/www.d.ts +0 -3
  115. package/dist/i3s-server/bin/www.d.ts.map +0 -1
  116. package/dist/i3s-server/bin/www.js +0 -46
  117. package/dist/i3s-server/controllers/slpk-controller.d.ts +0 -13
  118. package/dist/i3s-server/controllers/slpk-controller.d.ts.map +0 -1
  119. package/dist/i3s-server/controllers/slpk-controller.js +0 -32
  120. package/dist/i3s-server/routes/slpk-router.d.ts +0 -3
  121. package/dist/i3s-server/routes/slpk-router.d.ts.map +0 -1
  122. package/dist/i3s-server/routes/slpk-router.js +0 -40
  123. package/dist/i3s-server/utils/create-scene-server.d.ts +0 -17
  124. package/dist/i3s-server/utils/create-scene-server.d.ts.map +0 -1
  125. package/dist/i3s-server/utils/create-scene-server.js +0 -18
  126. package/dist/i3s-server/utils/server-utils.d.ts +0 -21
  127. package/dist/i3s-server/utils/server-utils.d.ts.map +0 -1
  128. package/dist/i3s-server/utils/server-utils.js +0 -60
  129. package/dist/index.cjs +0 -6228
  130. package/dist/index.cjs.map +0 -7
  131. package/dist/index.d.ts +0 -3
  132. package/dist/index.d.ts.map +0 -1
  133. package/dist/index.js +0 -2
  134. package/dist/lib/json-schemas/conversion-dump-json-schema.d.ts +0 -463
  135. package/dist/lib/json-schemas/conversion-dump-json-schema.d.ts.map +0 -1
  136. package/dist/lib/json-schemas/conversion-dump-json-schema.js +0 -285
  137. package/dist/lib/utils/cli-utils.d.ts +0 -34
  138. package/dist/lib/utils/cli-utils.d.ts.map +0 -1
  139. package/dist/lib/utils/cli-utils.js +0 -76
  140. package/dist/lib/utils/compress-util.d.ts +0 -8
  141. package/dist/lib/utils/compress-util.d.ts.map +0 -1
  142. package/dist/lib/utils/compress-util.js +0 -25
  143. package/dist/lib/utils/conversion-dump.d.ts +0 -147
  144. package/dist/lib/utils/conversion-dump.d.ts.map +0 -1
  145. package/dist/lib/utils/conversion-dump.js +0 -257
  146. package/dist/lib/utils/file-utils.d.ts +0 -57
  147. package/dist/lib/utils/file-utils.d.ts.map +0 -1
  148. package/dist/lib/utils/file-utils.js +0 -140
  149. package/dist/lib/utils/geometry-utils.d.ts +0 -9
  150. package/dist/lib/utils/geometry-utils.d.ts.map +0 -1
  151. package/dist/lib/utils/geometry-utils.js +0 -14
  152. package/dist/lib/utils/lod-conversion-utils.d.ts +0 -42
  153. package/dist/lib/utils/lod-conversion-utils.d.ts.map +0 -1
  154. package/dist/lib/utils/lod-conversion-utils.js +0 -71
  155. package/dist/lib/utils/queue.d.ts +0 -7
  156. package/dist/lib/utils/queue.d.ts.map +0 -1
  157. package/dist/lib/utils/queue.js +0 -14
  158. package/dist/lib/utils/statistic-utils.d.ts +0 -20
  159. package/dist/lib/utils/statistic-utils.d.ts.map +0 -1
  160. package/dist/lib/utils/statistic-utils.js +0 -88
  161. package/dist/lib/utils/write-queue.d.ts +0 -44
  162. package/dist/lib/utils/write-queue.d.ts.map +0 -1
  163. package/dist/lib/utils/write-queue.js +0 -82
  164. package/dist/pgm-loader.d.ts +0 -28
  165. package/dist/pgm-loader.d.ts.map +0 -1
  166. package/dist/pgm-loader.js +0 -24
@@ -1,95 +0,0 @@
1
- export declare const STORE: {
2
- id: {
3
- path: string;
4
- transform: (val: any) => any;
5
- };
6
- profile: {
7
- path: string;
8
- default: string;
9
- };
10
- version: {
11
- path: string;
12
- default: string;
13
- };
14
- resourcePattern: {
15
- path: string;
16
- default: string[];
17
- };
18
- rootNode: {
19
- path: string;
20
- default: string;
21
- };
22
- extent: {
23
- path: string;
24
- };
25
- indexCRS: {
26
- path: string;
27
- default: string;
28
- };
29
- vertexCRS: {
30
- path: string;
31
- default: string;
32
- };
33
- normalReferenceFrame: {
34
- path: string;
35
- default: string;
36
- };
37
- attributeEncoding: {
38
- path: string;
39
- default: string;
40
- };
41
- textureEncoding: {
42
- path: string;
43
- default: string[];
44
- };
45
- lodType: {
46
- path: string;
47
- default: string;
48
- };
49
- lodModel: {
50
- path: string;
51
- default: string;
52
- };
53
- defaultGeometrySchema: {
54
- path: string;
55
- default: {
56
- geometryType: string;
57
- header: {
58
- property: string;
59
- type: string;
60
- }[];
61
- topology: string;
62
- ordering: string[];
63
- vertexAttributes: {
64
- position: {
65
- valueType: string;
66
- valuesPerElement: number;
67
- };
68
- normal: {
69
- valueType: string;
70
- valuesPerElement: number;
71
- };
72
- uv0: {
73
- valueType: string;
74
- valuesPerElement: number;
75
- };
76
- color: {
77
- valueType: string;
78
- valuesPerElement: number;
79
- };
80
- };
81
- featureAttributeOrder: string[];
82
- featureAttributes: {
83
- id: {
84
- valueType: string;
85
- valuesPerElement: number;
86
- };
87
- faceRange: {
88
- valueType: string;
89
- valuesPerElement: number;
90
- };
91
- };
92
- };
93
- };
94
- };
95
- //# sourceMappingURL=store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/json-templates/store.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmGjB,CAAC"}
@@ -1,100 +0,0 @@
1
- export const STORE = {
2
- id: {
3
- path: 'id',
4
- transform: (val) => val.toUpperCase()
5
- },
6
- profile: {
7
- path: 'profile',
8
- default: 'meshpyramids'
9
- },
10
- version: {
11
- path: 'version',
12
- default: '1.8'
13
- },
14
- resourcePattern: {
15
- path: 'resourcePattern',
16
- default: ['3dNodeIndexDocument', 'Attributes', 'SharedResource', 'Geometry']
17
- },
18
- rootNode: {
19
- path: 'rootNode',
20
- default: './nodes/root'
21
- },
22
- extent: {
23
- path: 'extent'
24
- },
25
- indexCRS: {
26
- path: 'indexCRS',
27
- default: 'http://www.opengis.net/def/crs/EPSG/0/4326'
28
- },
29
- vertexCRS: {
30
- path: 'vertexCRS',
31
- default: 'http://www.opengis.net/def/crs/EPSG/0/4326'
32
- },
33
- normalReferenceFrame: {
34
- path: 'normalReferenceFrame',
35
- default: 'east-north-up'
36
- },
37
- attributeEncoding: {
38
- path: 'attributeEncoding',
39
- default: 'application/octet-stream; version=1.6'
40
- },
41
- textureEncoding: {
42
- path: 'textureEncoding',
43
- default: ['image/jpeg', 'image/ktx2']
44
- },
45
- lodType: {
46
- path: 'lodType',
47
- default: 'MeshPyramid'
48
- },
49
- lodModel: {
50
- path: 'lodModel',
51
- default: 'node-switching'
52
- },
53
- defaultGeometrySchema: {
54
- path: 'defaultGeometrySchema',
55
- default: {
56
- geometryType: 'triangles',
57
- header: [
58
- {
59
- property: 'vertexCount',
60
- type: 'UInt32'
61
- },
62
- {
63
- property: 'featureCount',
64
- type: 'UInt32'
65
- }
66
- ],
67
- topology: 'PerAttributeArray',
68
- ordering: ['position', 'normal', 'uv0', 'color'],
69
- vertexAttributes: {
70
- position: {
71
- valueType: 'Float32',
72
- valuesPerElement: 3
73
- },
74
- normal: {
75
- valueType: 'Float32',
76
- valuesPerElement: 3
77
- },
78
- uv0: {
79
- valueType: 'Float32',
80
- valuesPerElement: 2
81
- },
82
- color: {
83
- valueType: 'UInt8',
84
- valuesPerElement: 4
85
- }
86
- },
87
- featureAttributeOrder: ['id', 'faceRange'],
88
- featureAttributes: {
89
- id: {
90
- valueType: 'UInt64',
91
- valuesPerElement: 1
92
- },
93
- faceRange: {
94
- valueType: 'UInt32',
95
- valuesPerElement: 2
96
- }
97
- }
98
- }
99
- }
100
- };
@@ -1,226 +0,0 @@
1
- import { GLTFImagePostprocessed, GLTFNodePostprocessed } from '@loaders.gl/gltf';
2
- import { BoundingVolumes, I3SMaterialDefinition, MaterialDefinitionInfo, TextureDefinitionInfo } from '@loaders.gl/i3s';
3
- import { Matrix4, Vector3 } from '@math.gl/core';
4
- /** Converted resources for specific node */
5
- export type I3SConvertedResources = {
6
- /**
7
- * Node id
8
- */
9
- nodeId?: number;
10
- /** Non-compressed geometry buffer that have structure met
11
- * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
12
- * (Geometry buffer)
13
- */
14
- geometry: ArrayBuffer | null;
15
- /**
16
- * Draco compressed geometry
17
- */
18
- compressedGeometry?: Promise<ArrayBuffer> | null;
19
- /**
20
- * Texture image content
21
- */
22
- texture: any | null;
23
- /**
24
- * If the resource has uvRegions geometry attribute
25
- */
26
- hasUvRegions: boolean;
27
- /**
28
- * Shared resources built from GLTF material
29
- */
30
- sharedResources: SharedResourcesArrays | null;
31
- /**
32
- * Material definition of the node
33
- */
34
- meshMaterial?: I3SMaterialDefinition | null;
35
- /**
36
- * Number of vertices in the node
37
- */
38
- vertexCount: number | null;
39
- /**
40
- * Feature attributes contents
41
- */
42
- attributes: ArrayBuffer[] | null;
43
- /**
44
- * Number of features in the node
45
- */
46
- featureCount: number | null;
47
- /**
48
- * MBS and/or OBB bounding volumes of the node
49
- */
50
- boundingVolumes: BoundingVolumes | null;
51
- };
52
- /**
53
- * Geometry and feature attributes converted from GLTF primitives
54
- */
55
- export type ConvertedAttributes = {
56
- /** POSITION attribute value */
57
- positions: Float32Array;
58
- /** NORMAL attribute value */
59
- normals: Float32Array;
60
- /** TEXCOORD_0 attribute value */
61
- texCoords: Float32Array;
62
- /** COLOR_0 attribute value */
63
- colors: Uint8Array;
64
- /** uvRegion attribute for a texture atlas */
65
- uvRegions: Uint16Array;
66
- /** Feature indices grouped by ...
67
- * converted from "batch ids" of GLTF
68
- */
69
- featureIndicesGroups?: number[][];
70
- /** Feature indices converted from "batch ids" */
71
- featureIndices: number[];
72
- /**
73
- * MBS and/or OBB bounding volumes of the node
74
- */
75
- boundingVolumes: null | BoundingVolumes;
76
- /** merged materials data */
77
- mergedMaterials: MergedMaterial[];
78
- };
79
- /** Postprocessed geometry and feature attributes
80
- * https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
81
- */
82
- export type GeometryAttributes = {
83
- /** POSITION attribute value */
84
- positions: Float32Array;
85
- /** NORMAL attribute value */
86
- normals: Float32Array;
87
- /** TEXCOORD_0 attribute value */
88
- texCoords: Float32Array;
89
- /** COLOR_0 attribute value */
90
- colors: Uint8Array;
91
- /** uvRegion attribute for a texture atlas */
92
- uvRegions: Uint16Array;
93
- /** faceRanges attribute value */
94
- faceRange: Uint32Array;
95
- /** feature Ids attribute value */
96
- featureIds: number[];
97
- /** number of features in the node */
98
- featureCount: number;
99
- };
100
- /** Geometry attributes applicable for reordering by featureId */
101
- export type GroupedAttributes = {
102
- /** POSITION attribute value */
103
- positions: Float32Array;
104
- /** NORMAL attribute value */
105
- normals: Float32Array;
106
- /** COLOR_0 attribute value */
107
- colors: Uint8Array;
108
- /** uvRegion attribute for a texture atlas */
109
- uvRegions: Uint16Array;
110
- /** TEXCOORD_0 attribute value */
111
- texCoords: Float32Array;
112
- };
113
- /** Geometry attributes specific for the particular feature */
114
- export type GroupedByFeatureIdAttributes = GroupedAttributes & {
115
- /** Feature Id */
116
- featureId: number;
117
- };
118
- /** Shared resources made from GLTF material */
119
- export type SharedResourcesArrays = {
120
- /** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */
121
- materialDefinitionInfos?: MaterialDefinitionInfo[];
122
- /** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/
123
- textureDefinitionInfos?: TextureDefinitionInfo[];
124
- /** node id to make unique SharedResource ids */
125
- nodePath?: string;
126
- };
127
- /** I3S material definition and texture content taken from GLTF material */
128
- export type I3SMaterialWithTexture = {
129
- /** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */
130
- material: I3SMaterialDefinition;
131
- /** Texture content (image) */
132
- texture?: GLTFImagePostprocessed;
133
- /** Metadata of all merged materials */
134
- mergedMaterials: MergedMaterial[];
135
- };
136
- /** Metadata of some original texture */
137
- export type MergedMaterial = {
138
- /** Gltf material Id */
139
- originalMaterialId: string;
140
- /** Original texture size */
141
- textureSize?: {
142
- width: number;
143
- height: number;
144
- };
145
- /** Uint16Array of 4 elements https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md */
146
- uvRegion?: Uint16Array;
147
- };
148
- export type TypedArrayConstructor = Uint8ArrayConstructor | Int8ArrayConstructor | Uint16ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
149
- /**
150
- * glTF primitive modes (mesh topology types)
151
- * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode
152
- */
153
- export declare enum GLTFPrimitiveModeString {
154
- POINTS = "POINTS",
155
- LINES = "LINES",
156
- LINE_LOOP = "LINE_LOOP",
157
- LINE_STRIP = "LINE_STRIP",
158
- TRIANGLES = "TRIANGLES",
159
- TRIANGLE_STRIP = "TRIANGLE_STRIP",
160
- TRIANGLE_FAN = "TRIANGLE_FAN"
161
- }
162
- /** Preprocessed data gathered from child tiles binary content */
163
- export type PreprocessData = {
164
- /** Mesh topology types used in gltf primitives of the tileset */
165
- meshTopologyTypes: Set<GLTFPrimitiveModeString>;
166
- /**
167
- * Feature 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;
203
- };
204
- /**
205
- * I3S' types difine the following:
206
- * type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;
207
- * The AttributeType contains the string values of the Attribute type.
208
- */
209
- export declare const AttributeType: {
210
- /** Type of attribute that is linked with feature ids */
211
- readonly OBJECT_ID_TYPE: "OBJECTID";
212
- /** String data type name for feature attributes */
213
- readonly STRING_TYPE: "string";
214
- /** Double data type name for feature attributes */
215
- readonly DOUBLE_TYPE: "double";
216
- /** Integer data type name for feature attributes */
217
- readonly SHORT_INT_TYPE: "Int32";
218
- };
219
- export declare enum ResourceType {
220
- ATTRIBUTES = "ATTRIBUTES",
221
- DRACO_GEOMETRY = "DRACO_GEOMETRY",
222
- GEOMETRY = "GEOMETRY",
223
- SHARED = "SHARED",
224
- TEXTURE = "TEXTURE"
225
- }
226
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
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;IACH,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACjD;;OAEG;IACH,OAAO,EAAE,GAAG,GAAG,I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C;CAC/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa;IACxB,wDAAwD;;IAExD,mDAAmD;;IAEnD,mDAAmD;;IAEnD,oDAAoD;;CAE5C,CAAC;AAEX,oBAAY,YAAY;IACtB,UAAU,eAAe;IACzB,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB"}
@@ -1,37 +0,0 @@
1
- /**
2
- * glTF primitive modes (mesh topology types)
3
- * @see https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode
4
- */
5
- export var GLTFPrimitiveModeString;
6
- (function (GLTFPrimitiveModeString) {
7
- GLTFPrimitiveModeString["POINTS"] = "POINTS";
8
- GLTFPrimitiveModeString["LINES"] = "LINES";
9
- GLTFPrimitiveModeString["LINE_LOOP"] = "LINE_LOOP";
10
- GLTFPrimitiveModeString["LINE_STRIP"] = "LINE_STRIP";
11
- GLTFPrimitiveModeString["TRIANGLES"] = "TRIANGLES";
12
- GLTFPrimitiveModeString["TRIANGLE_STRIP"] = "TRIANGLE_STRIP";
13
- GLTFPrimitiveModeString["TRIANGLE_FAN"] = "TRIANGLE_FAN";
14
- })(GLTFPrimitiveModeString || (GLTFPrimitiveModeString = {}));
15
- /**
16
- * I3S' types difine the following:
17
- * type Attribute = 'OBJECTID' | 'string' | 'double' | 'Int32' | string;
18
- * The AttributeType contains the string values of the Attribute type.
19
- */
20
- export const AttributeType = {
21
- /** Type of attribute that is linked with feature ids */
22
- OBJECT_ID_TYPE: 'OBJECTID',
23
- /** String data type name for feature attributes */
24
- STRING_TYPE: 'string',
25
- /** Double data type name for feature attributes */
26
- DOUBLE_TYPE: 'double',
27
- /** Integer data type name for feature attributes */
28
- SHORT_INT_TYPE: 'Int32'
29
- };
30
- export var ResourceType;
31
- (function (ResourceType) {
32
- ResourceType["ATTRIBUTES"] = "ATTRIBUTES";
33
- ResourceType["DRACO_GEOMETRY"] = "DRACO_GEOMETRY";
34
- ResourceType["GEOMETRY"] = "GEOMETRY";
35
- ResourceType["SHARED"] = "SHARED";
36
- ResourceType["TEXTURE"] = "TEXTURE";
37
- })(ResourceType || (ResourceType = {}));
@@ -1,3 +0,0 @@
1
- import express from 'express';
2
- export declare let app: ReturnType<typeof express> | undefined;
3
- //# sourceMappingURL=app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/i3s-server/app.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAgB9B,eAAO,IAAI,GAAG,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,GAAG,SAAS,CAAC"}
@@ -1,31 +0,0 @@
1
- import express from 'express';
2
- import path from 'path';
3
- import logger from 'morgan';
4
- import cors from 'cors';
5
- // For local debug
6
- // import {fileURLToPath} from 'url';
7
- import { loadArchive } from "./controllers/slpk-controller.js";
8
- import { sceneServerRouter, router } from "./routes/slpk-router.js";
9
- // For local debug
10
- // const __filename = fileURLToPath(import.meta.url);
11
- // const __dirname = path.dirname(__filename);
12
- const I3S_LAYER_PATH = process.env.I3sLayerPath || ''; // eslint-disable-line no-process-env, no-undef
13
- const FULL_LAYER_PATH = path.join(process.cwd(), I3S_LAYER_PATH); // eslint-disable-line no-undef
14
- export let app;
15
- if (/\.slpk$/.test(I3S_LAYER_PATH)) {
16
- app = express();
17
- app.use(logger('dev'));
18
- app.use(express.json());
19
- app.use(express.urlencoded({ extended: false }));
20
- app.use(express.static(path.join(__dirname, 'public')));
21
- app.use(cors());
22
- let filePath = FULL_LAYER_PATH;
23
- // Checks if the first character is not a point to indicate absolute path
24
- const absolutePath = /^[^.]/.exec(I3S_LAYER_PATH);
25
- if (absolutePath) {
26
- filePath = I3S_LAYER_PATH;
27
- }
28
- loadArchive(filePath);
29
- app.use('/SceneServer/layers/0', router);
30
- app.use('/SceneServer', sceneServerRouter);
31
- }
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=www.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"www.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/bin/www.ts"],"names":[],"mappings":""}
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env node
2
- import { app } from "../app.js";
3
- import https from 'https';
4
- import http from 'http';
5
- import fs from 'fs';
6
- import path from 'path';
7
- // For local debug
8
- // import {fileURLToPath} from 'url';
9
- import { formErrorHandler, formListeningHandler, normalizePort } from "../utils/server-utils.js";
10
- // For local debug
11
- // const __filename = fileURLToPath(import.meta.url);
12
- // const __dirname = path.dirname(__filename);
13
- /** Get port from environment and store in Express. */
14
- // eslint-disable-next-line no-process-env
15
- const httpPort = normalizePort(process.env.PORT || '80');
16
- if (httpPort === false) {
17
- // eslint-disable-next-line no-console
18
- console.error('Incorrect HTTP port');
19
- process.exit(1); // eslint-disable-line no-process-exit
20
- }
21
- // eslint-disable-next-line no-process-env
22
- const httpsPort = normalizePort(process.env.HTTPS_PORT || '443');
23
- if (httpsPort === false) {
24
- // eslint-disable-next-line no-console
25
- console.error('Incorrect HTTPs port');
26
- process.exit(1); // eslint-disable-line no-process-exit
27
- }
28
- /** Create HTTP server. */
29
- const options = {
30
- key: fs.readFileSync(path.join(__dirname, '../certs/key.pem')),
31
- cert: fs.readFileSync(path.join(__dirname, '../certs/cert.pem'))
32
- };
33
- if (!app) {
34
- // eslint-disable-next-line no-console
35
- console.error('This server supports *.slpk files only');
36
- process.exit(1); // eslint-disable-line no-process-exit
37
- }
38
- const httpServer = http.createServer(app);
39
- const httpsServer = https.createServer(options, app);
40
- /** Listen on provided port, on all network interfaces. */
41
- httpServer.listen(httpPort);
42
- httpServer.on('error', formErrorHandler(httpPort));
43
- httpServer.on('listening', formListeningHandler(httpServer));
44
- httpsServer.listen(httpsPort);
45
- httpsServer.on('error', formErrorHandler(httpsPort));
46
- httpsServer.on('listening', formListeningHandler(httpsServer));
@@ -1,13 +0,0 @@
1
- import '@loaders.gl/polyfills';
2
- /**
3
- * Open SLPK file for reading and load HASH file
4
- * @param fullLayerPath - full path to SLPK file
5
- */
6
- export declare function loadArchive(fullLayerPath: string): Promise<void>;
7
- /**
8
- * Get a file from SLPK
9
- * @param url - I3S HTTP URL
10
- * @returns - file content
11
- */
12
- export declare function getFileByUrl(url: string): Promise<ArrayBuffer | null>;
13
- //# sourceMappingURL=slpk-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slpk-controller.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/controllers/slpk-controller.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAM/B;;;GAGG;AACH,wBAAsB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOtE;AAED;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAW3E"}
@@ -1,32 +0,0 @@
1
- import '@loaders.gl/polyfills';
2
- import { parseSLPKArchive } from '@loaders.gl/i3s';
3
- import { FileHandleFile } from '@loaders.gl/loader-utils';
4
- let slpkArchive;
5
- /**
6
- * Open SLPK file for reading and load HASH file
7
- * @param fullLayerPath - full path to SLPK file
8
- */
9
- export async function loadArchive(fullLayerPath) {
10
- slpkArchive = await parseSLPKArchive(new FileHandleFile(fullLayerPath), (msg) => console.log(msg) // eslint-disable-line no-console
11
- );
12
- // eslint-disable-next-line no-console
13
- console.log('The server is ready to use');
14
- }
15
- /**
16
- * Get a file from SLPK
17
- * @param url - I3S HTTP URL
18
- * @returns - file content
19
- */
20
- export async function getFileByUrl(url) {
21
- const trimmedPath = /^\/?(.*)\/?$/.exec(url);
22
- if (trimmedPath) {
23
- try {
24
- const uncompressedFile = await slpkArchive.getFile(trimmedPath[1], 'http');
25
- return uncompressedFile;
26
- }
27
- catch {
28
- // TODO - log error?
29
- }
30
- }
31
- return null;
32
- }
@@ -1,3 +0,0 @@
1
- export declare const sceneServerRouter: any;
2
- export declare const router: any;
3
- //# sourceMappingURL=slpk-router.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slpk-router.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/routes/slpk-router.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,EAAE,GAAsB,CAAC;AAgBvD,eAAO,MAAM,MAAM,EAAE,GAAsB,CAAC"}
@@ -1,40 +0,0 @@
1
- import express from 'express';
2
- import { getFileByUrl } from "../controllers/slpk-controller.js";
3
- import { createSceneServer } from "../utils/create-scene-server.js";
4
- const textDecoder = new TextDecoder();
5
- export const sceneServerRouter = express.Router();
6
- sceneServerRouter.get('*', (req, res, next) => {
7
- async function routerCallback(req, res, next) {
8
- const file = await getFileByUrl('/');
9
- if (file) {
10
- const layer = JSON.parse(textDecoder.decode(file));
11
- const sceneServerResponse = createSceneServer(layer.name, layer);
12
- res.send(sceneServerResponse);
13
- }
14
- else {
15
- res.status(404);
16
- res.send('File not found');
17
- }
18
- }
19
- routerCallback(req, res, next);
20
- });
21
- export const router = express.Router();
22
- router.get('*', (req, res, next) => {
23
- async function routerCallback(req, res, next) {
24
- const file = await getFileByUrl(req.path.replace(/\/+$/, ''));
25
- if (file) {
26
- try {
27
- const json = JSON.parse(textDecoder.decode(file));
28
- res.send(json);
29
- }
30
- catch (e) {
31
- res.send(Buffer.from(file));
32
- }
33
- }
34
- else {
35
- res.status(404);
36
- res.send('File not found');
37
- }
38
- }
39
- routerCallback(req, res, next);
40
- });