@loaders.gl/i3s 4.0.0-alpha.9 → 4.0.0-beta.2

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 (213) hide show
  1. package/dist/dist.min.js +4925 -445
  2. package/dist/es5/arcgis-webscene-loader.js +4 -4
  3. package/dist/es5/arcgis-webscene-loader.js.map +1 -1
  4. package/dist/es5/i3s-attribute-loader.js +1 -1
  5. package/dist/es5/i3s-attribute-loader.js.map +1 -1
  6. package/dist/es5/i3s-building-scene-layer-loader.js +1 -1
  7. package/dist/es5/i3s-building-scene-layer-loader.js.map +1 -1
  8. package/dist/es5/i3s-content-loader.js +1 -1
  9. package/dist/es5/i3s-content-loader.js.map +1 -1
  10. package/dist/es5/i3s-loader.js +6 -6
  11. package/dist/es5/i3s-loader.js.map +1 -1
  12. package/dist/es5/i3s-node-page-loader.js +14 -12
  13. package/dist/es5/i3s-node-page-loader.js.map +1 -1
  14. package/dist/es5/i3s-slpk-loader.js +30 -2
  15. package/dist/es5/i3s-slpk-loader.js.map +1 -1
  16. package/dist/es5/index.js +9 -2
  17. package/dist/es5/index.js.map +1 -1
  18. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js +9 -5
  19. package/dist/es5/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
  20. package/dist/es5/lib/parsers/constants.js +14 -15
  21. package/dist/es5/lib/parsers/constants.js.map +1 -1
  22. package/dist/es5/lib/parsers/parse-arcgis-webscene.js.map +1 -1
  23. package/dist/es5/lib/parsers/parse-i3s-tile-content.js +34 -31
  24. package/dist/es5/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  25. package/dist/es5/lib/parsers/parse-i3s.js +31 -19
  26. package/dist/es5/lib/parsers/parse-i3s.js.map +1 -1
  27. package/dist/es5/lib/parsers/parse-slpk/parse-slpk.js +42 -67
  28. package/dist/es5/lib/parsers/parse-slpk/parse-slpk.js.map +1 -1
  29. package/dist/es5/lib/parsers/parse-slpk/slpk-archieve.js +76 -51
  30. package/dist/es5/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -1
  31. package/dist/es5/lib/utils/customize-/321/201olors.js.map +1 -1
  32. package/dist/es5/lib/utils/url-utils.js +3 -3
  33. package/dist/es5/lib/utils/url-utils.js.map +1 -1
  34. package/dist/es5/types.js +1 -14
  35. package/dist/es5/types.js.map +1 -1
  36. package/dist/esm/arcgis-webscene-loader.js +2 -2
  37. package/dist/esm/arcgis-webscene-loader.js.map +1 -1
  38. package/dist/esm/i3s-attribute-loader.js +1 -1
  39. package/dist/esm/i3s-attribute-loader.js.map +1 -1
  40. package/dist/esm/i3s-building-scene-layer-loader.js +1 -1
  41. package/dist/esm/i3s-building-scene-layer-loader.js.map +1 -1
  42. package/dist/esm/i3s-content-loader.js +1 -1
  43. package/dist/esm/i3s-content-loader.js.map +1 -1
  44. package/dist/esm/i3s-loader.js +3 -4
  45. package/dist/esm/i3s-loader.js.map +1 -1
  46. package/dist/esm/i3s-node-page-loader.js +7 -5
  47. package/dist/esm/i3s-node-page-loader.js.map +1 -1
  48. package/dist/esm/i3s-slpk-loader.js +8 -2
  49. package/dist/esm/i3s-slpk-loader.js.map +1 -1
  50. package/dist/esm/index.js +2 -1
  51. package/dist/esm/index.js.map +1 -1
  52. package/dist/esm/lib/helpers/i3s-nodepages-tiles.js +9 -5
  53. package/dist/esm/lib/helpers/i3s-nodepages-tiles.js.map +1 -1
  54. package/dist/esm/lib/parsers/constants.js +14 -15
  55. package/dist/esm/lib/parsers/constants.js.map +1 -1
  56. package/dist/esm/lib/parsers/parse-arcgis-webscene.js.map +1 -1
  57. package/dist/esm/lib/parsers/parse-i3s-tile-content.js +5 -2
  58. package/dist/esm/lib/parsers/parse-i3s-tile-content.js.map +1 -1
  59. package/dist/esm/lib/parsers/parse-i3s.js +23 -12
  60. package/dist/esm/lib/parsers/parse-i3s.js.map +1 -1
  61. package/dist/esm/lib/parsers/parse-slpk/parse-slpk.js +19 -33
  62. package/dist/esm/lib/parsers/parse-slpk/parse-slpk.js.map +1 -1
  63. package/dist/esm/lib/parsers/parse-slpk/slpk-archieve.js +23 -32
  64. package/dist/esm/lib/parsers/parse-slpk/slpk-archieve.js.map +1 -1
  65. package/dist/esm/lib/utils/customize-/321/201olors.js.map +1 -1
  66. package/dist/esm/lib/utils/url-utils.js +2 -3
  67. package/dist/esm/lib/utils/url-utils.js.map +1 -1
  68. package/dist/esm/types.js +0 -12
  69. package/dist/esm/types.js.map +1 -1
  70. package/dist/i3s-content-worker-node.js +48 -48
  71. package/dist/i3s-content-worker-node.js.map +3 -3
  72. package/dist/i3s-content-worker.js +191 -126
  73. package/dist/src/arcgis-webscene-loader.d.ts +9 -0
  74. package/dist/src/arcgis-webscene-loader.d.ts.map +1 -0
  75. package/dist/src/bundle.d.ts.map +1 -0
  76. package/dist/{i3s-attribute-loader.d.ts → src/i3s-attribute-loader.d.ts} +3 -2
  77. package/dist/src/i3s-attribute-loader.d.ts.map +1 -0
  78. package/dist/src/i3s-building-scene-layer-loader.d.ts +8 -0
  79. package/dist/src/i3s-building-scene-layer-loader.d.ts.map +1 -0
  80. package/dist/src/i3s-content-loader.d.ts +8 -0
  81. package/dist/src/i3s-content-loader.d.ts.map +1 -0
  82. package/dist/src/i3s-loader.d.ts +11 -0
  83. package/dist/src/i3s-loader.d.ts.map +1 -0
  84. package/dist/src/i3s-node-page-loader.d.ts +8 -0
  85. package/dist/src/i3s-node-page-loader.d.ts.map +1 -0
  86. package/dist/src/i3s-slpk-loader.d.ts +15 -0
  87. package/dist/src/i3s-slpk-loader.d.ts.map +1 -0
  88. package/dist/src/index.d.ts +12 -0
  89. package/dist/src/index.d.ts.map +1 -0
  90. package/dist/{lib → src/lib}/helpers/i3s-nodepages-tiles.d.ts +5 -3
  91. package/dist/src/lib/helpers/i3s-nodepages-tiles.d.ts.map +1 -0
  92. package/dist/src/lib/parsers/constants.d.ts.map +1 -0
  93. package/dist/src/lib/parsers/parse-arcgis-webscene.d.ts +7 -0
  94. package/dist/src/lib/parsers/parse-arcgis-webscene.d.ts.map +1 -0
  95. package/dist/src/lib/parsers/parse-i3s-attribute.d.ts.map +1 -0
  96. package/dist/src/lib/parsers/parse-i3s-building-scene-layer.d.ts.map +1 -0
  97. package/dist/{lib → src/lib}/parsers/parse-i3s-tile-content.d.ts +1 -1
  98. package/dist/src/lib/parsers/parse-i3s-tile-content.d.ts.map +1 -0
  99. package/dist/{lib → src/lib}/parsers/parse-i3s.d.ts +2 -2
  100. package/dist/src/lib/parsers/parse-i3s.d.ts.map +1 -0
  101. package/dist/src/lib/parsers/parse-slpk/parse-slpk.d.ts +10 -0
  102. package/dist/src/lib/parsers/parse-slpk/parse-slpk.d.ts.map +1 -0
  103. package/dist/{lib → src/lib}/parsers/parse-slpk/slpk-archieve.d.ts +6 -12
  104. package/dist/src/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +1 -0
  105. package/dist/src/lib/utils/convert-i3s-obb-to-mbs.d.ts.map +1 -0
  106. package/dist/src/lib/utils/customize-/321/201olors.d.ts.map +1 -0
  107. package/dist/{lib → src/lib}/utils/url-utils.d.ts +5 -4
  108. package/dist/src/lib/utils/url-utils.d.ts.map +1 -0
  109. package/dist/{types.d.ts → src/types.d.ts} +138 -74
  110. package/dist/src/types.d.ts.map +1 -0
  111. package/dist/src/workers/i3s-content-worker-node.d.ts.map +1 -0
  112. package/dist/src/workers/i3s-content-worker.d.ts.map +1 -0
  113. package/dist/tsconfig.tsbuildinfo +1 -0
  114. package/package.json +9 -9
  115. package/src/arcgis-webscene-loader.ts +12 -6
  116. package/src/i3s-attribute-loader.ts +2 -1
  117. package/src/i3s-building-scene-layer-loader.ts +6 -1
  118. package/src/i3s-content-loader.ts +3 -2
  119. package/src/i3s-loader.ts +6 -8
  120. package/src/i3s-node-page-loader.ts +9 -6
  121. package/src/i3s-slpk-loader.ts +21 -3
  122. package/src/index.ts +6 -2
  123. package/src/lib/helpers/i3s-nodepages-tiles.ts +16 -9
  124. package/src/lib/parsers/constants.ts +14 -15
  125. package/src/lib/parsers/parse-arcgis-webscene.ts +2 -2
  126. package/src/lib/parsers/parse-i3s-tile-content.ts +7 -9
  127. package/src/lib/parsers/parse-i3s.ts +30 -18
  128. package/src/lib/parsers/parse-slpk/parse-slpk.ts +43 -55
  129. package/src/lib/parsers/parse-slpk/slpk-archieve.ts +30 -62
  130. package/src/lib/utils/customize-/321/201olors.ts +2 -2
  131. package/src/lib/utils/url-utils.ts +6 -5
  132. package/src/types.ts +143 -91
  133. package/dist/arcgis-webscene-loader.d.ts +0 -7
  134. package/dist/arcgis-webscene-loader.d.ts.map +0 -1
  135. package/dist/arcgis-webscene-loader.js +0 -28
  136. package/dist/bundle.d.ts.map +0 -1
  137. package/dist/bundle.js +0 -5
  138. package/dist/es5/lib/parsers/parse-zip/cd-file-header.js +0 -44
  139. package/dist/es5/lib/parsers/parse-zip/cd-file-header.js.map +0 -1
  140. package/dist/es5/lib/parsers/parse-zip/local-file-header.js +0 -26
  141. package/dist/es5/lib/parsers/parse-zip/local-file-header.js.map +0 -1
  142. package/dist/esm/lib/parsers/parse-zip/cd-file-header.js +0 -37
  143. package/dist/esm/lib/parsers/parse-zip/cd-file-header.js.map +0 -1
  144. package/dist/esm/lib/parsers/parse-zip/local-file-header.js +0 -19
  145. package/dist/esm/lib/parsers/parse-zip/local-file-header.js.map +0 -1
  146. package/dist/i3s-attribute-loader.d.ts.map +0 -1
  147. package/dist/i3s-attribute-loader.js +0 -175
  148. package/dist/i3s-building-scene-layer-loader.d.ts +0 -6
  149. package/dist/i3s-building-scene-layer-loader.d.ts.map +0 -1
  150. package/dist/i3s-building-scene-layer-loader.js +0 -26
  151. package/dist/i3s-content-loader.d.ts +0 -6
  152. package/dist/i3s-content-loader.d.ts.map +0 -1
  153. package/dist/i3s-content-loader.js +0 -32
  154. package/dist/i3s-loader.d.ts +0 -11
  155. package/dist/i3s-loader.d.ts.map +0 -1
  156. package/dist/i3s-loader.js +0 -102
  157. package/dist/i3s-node-page-loader.d.ts +0 -7
  158. package/dist/i3s-node-page-loader.d.ts.map +0 -1
  159. package/dist/i3s-node-page-loader.js +0 -22
  160. package/dist/i3s-slpk-loader.d.ts +0 -13
  161. package/dist/i3s-slpk-loader.d.ts.map +0 -1
  162. package/dist/i3s-slpk-loader.js +0 -20
  163. package/dist/index.d.ts +0 -10
  164. package/dist/index.d.ts.map +0 -1
  165. package/dist/index.js +0 -21
  166. package/dist/lib/helpers/i3s-nodepages-tiles.d.ts.map +0 -1
  167. package/dist/lib/helpers/i3s-nodepages-tiles.js +0 -242
  168. package/dist/lib/parsers/constants.d.ts.map +0 -1
  169. package/dist/lib/parsers/constants.js +0 -89
  170. package/dist/lib/parsers/parse-arcgis-webscene.d.ts +0 -7
  171. package/dist/lib/parsers/parse-arcgis-webscene.d.ts.map +0 -1
  172. package/dist/lib/parsers/parse-arcgis-webscene.js +0 -88
  173. package/dist/lib/parsers/parse-i3s-attribute.d.ts.map +0 -1
  174. package/dist/lib/parsers/parse-i3s-attribute.js +0 -99
  175. package/dist/lib/parsers/parse-i3s-building-scene-layer.d.ts.map +0 -1
  176. package/dist/lib/parsers/parse-i3s-building-scene-layer.js +0 -46
  177. package/dist/lib/parsers/parse-i3s-tile-content.d.ts.map +0 -1
  178. package/dist/lib/parsers/parse-i3s-tile-content.js +0 -499
  179. package/dist/lib/parsers/parse-i3s.d.ts.map +0 -1
  180. package/dist/lib/parsers/parse-i3s.js +0 -95
  181. package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts +0 -4
  182. package/dist/lib/parsers/parse-slpk/parse-slpk.d.ts.map +0 -1
  183. package/dist/lib/parsers/parse-slpk/parse-slpk.js +0 -50
  184. package/dist/lib/parsers/parse-slpk/slpk-archieve.d.ts.map +0 -1
  185. package/dist/lib/parsers/parse-slpk/slpk-archieve.js +0 -142
  186. package/dist/lib/parsers/parse-zip/cd-file-header.d.ts +0 -38
  187. package/dist/lib/parsers/parse-zip/cd-file-header.d.ts.map +0 -1
  188. package/dist/lib/parsers/parse-zip/cd-file-header.js +0 -48
  189. package/dist/lib/parsers/parse-zip/local-file-header.d.ts +0 -30
  190. package/dist/lib/parsers/parse-zip/local-file-header.d.ts.map +0 -1
  191. package/dist/lib/parsers/parse-zip/local-file-header.js +0 -28
  192. package/dist/lib/utils/convert-i3s-obb-to-mbs.d.ts.map +0 -1
  193. package/dist/lib/utils/convert-i3s-obb-to-mbs.js +0 -20
  194. package/dist/lib/utils/customize-/321/201olors.d.ts.map +0 -1
  195. package/dist/lib/utils/customize-/321/201olors.js +0 -104
  196. package/dist/lib/utils/url-utils.d.ts.map +0 -1
  197. package/dist/lib/utils/url-utils.js +0 -44
  198. package/dist/types.d.ts.map +0 -1
  199. package/dist/types.js +0 -20
  200. package/dist/workers/i3s-content-worker-node.d.ts.map +0 -1
  201. package/dist/workers/i3s-content-worker-node.js +0 -7
  202. package/dist/workers/i3s-content-worker.d.ts.map +0 -1
  203. package/dist/workers/i3s-content-worker.js +0 -5
  204. package/src/lib/parsers/parse-zip/cd-file-header.ts +0 -93
  205. package/src/lib/parsers/parse-zip/local-file-header.ts +0 -56
  206. /package/dist/{bundle.d.ts → src/bundle.d.ts} +0 -0
  207. /package/dist/{lib → src/lib}/parsers/constants.d.ts +0 -0
  208. /package/dist/{lib → src/lib}/parsers/parse-i3s-attribute.d.ts +0 -0
  209. /package/dist/{lib → src/lib}/parsers/parse-i3s-building-scene-layer.d.ts +0 -0
  210. /package/dist/{lib → src/lib}/utils/convert-i3s-obb-to-mbs.d.ts +0 -0
  211. /package/dist/{lib → src/lib}/utils/customize-/321/201olors.d.ts" +0 -0
  212. /package/dist/{workers → src/workers}/i3s-content-worker-node.d.ts +0 -0
  213. /package/dist/{workers → src/workers}/i3s-content-worker.d.ts +0 -0
@@ -1,175 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAttributeValueType = exports.loadFeatureAttributes = exports.I3SAttributeLoader = void 0;
4
- const core_1 = require("@loaders.gl/core");
5
- const parse_i3s_attribute_1 = require("./lib/parsers/parse-i3s-attribute");
6
- const url_utils_1 = require("./lib/utils/url-utils");
7
- // __VERSION__ is injected by babel-plugin-version-inline
8
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
9
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
10
- const EMPTY_VALUE = '';
11
- const REJECTED_STATUS = 'rejected';
12
- /**
13
- * Loader for I3S attributes
14
- */
15
- exports.I3SAttributeLoader = {
16
- name: 'I3S Attribute',
17
- id: 'i3s-attribute',
18
- module: 'i3s',
19
- version: VERSION,
20
- mimeTypes: ['application/binary'],
21
- parse: async (arrayBuffer, options) => (0, parse_i3s_attribute_1.parseI3STileAttribute)(arrayBuffer, options),
22
- extensions: ['bin'],
23
- options: {},
24
- binary: true
25
- };
26
- // TODO - these seem to use the loader rather than being part of the loader. Move to different file...
27
- /**
28
- * Load attributes based on feature id
29
- * @param {Object} tile
30
- * @param {number} featureId
31
- * @param {Object} options
32
- * @returns {Promise}
33
- */
34
- // eslint-disable-next-line complexity
35
- async function loadFeatureAttributes(tile, featureId, options = {}) {
36
- const { attributeStorageInfo, attributeUrls, tilesetFields } = getAttributesData(tile);
37
- if (!attributeStorageInfo || !attributeUrls || featureId < 0) {
38
- return null;
39
- }
40
- let attributes = [];
41
- const attributeLoadPromises = [];
42
- for (let index = 0; index < attributeStorageInfo.length; index++) {
43
- // @ts-ignore
44
- const url = (0, url_utils_1.getUrlWithToken)(attributeUrls[index], options.i3s?.token);
45
- const attributeName = attributeStorageInfo[index].name;
46
- const attributeType = getAttributeValueType(attributeStorageInfo[index]);
47
- const loadOptions = { ...options, attributeName, attributeType };
48
- const promise = (0, core_1.load)(url, exports.I3SAttributeLoader, loadOptions);
49
- attributeLoadPromises.push(promise);
50
- }
51
- try {
52
- attributes = await Promise.allSettled(attributeLoadPromises);
53
- }
54
- catch (error) {
55
- // do nothing
56
- }
57
- if (!attributes.length) {
58
- return null;
59
- }
60
- return generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields);
61
- }
62
- exports.loadFeatureAttributes = loadFeatureAttributes;
63
- /**
64
- * Gets attributes data from tile.
65
- * @param tile
66
- * @returns
67
- */
68
- function getAttributesData(tile) {
69
- const attributeStorageInfo = tile.tileset?.tileset?.attributeStorageInfo;
70
- const attributeUrls = tile.header?.attributeUrls;
71
- const tilesetFields = tile.tileset?.tileset?.fields || [];
72
- return { attributeStorageInfo, attributeUrls, tilesetFields };
73
- }
74
- /**
75
- * Get attribute value type based on property names
76
- * @param {Object} attribute
77
- * @returns {String}
78
- */
79
- function getAttributeValueType(attribute) {
80
- if (attribute.hasOwnProperty('objectIds')) {
81
- return 'Oid32';
82
- }
83
- else if (attribute.hasOwnProperty('attributeValues')) {
84
- return attribute.attributeValues.valueType;
85
- }
86
- return '';
87
- }
88
- exports.getAttributeValueType = getAttributeValueType;
89
- /**
90
- * Find in attributeStorageInfo attribute name responsible for feature ids list.
91
- * @param attributeStorageInfo
92
- * @returns Feature ids attribute name
93
- */
94
- function getFeatureIdsAttributeName(attributeStorageInfo) {
95
- const objectIdsAttribute = attributeStorageInfo.find(attribute => attribute.name.includes('OBJECTID'));
96
- return objectIdsAttribute?.name;
97
- }
98
- /**
99
- * Generates mapping featureId to feature attributes
100
- * @param {Array} attributes
101
- * @param {Object} attributeStorageInfo
102
- * @param {number} featureId
103
- * @returns {Object}
104
- */
105
- function generateAttributesByFeatureId(attributes, attributeStorageInfo, featureId, tilesetFields) {
106
- const objectIdsAttributeName = getFeatureIdsAttributeName(attributeStorageInfo);
107
- const objectIds = attributes.find((attribute) => attribute.value[objectIdsAttributeName]);
108
- if (!objectIds) {
109
- return null;
110
- }
111
- const attributeIndex = objectIds.value[objectIdsAttributeName].indexOf(featureId);
112
- if (attributeIndex < 0) {
113
- return null;
114
- }
115
- return getFeatureAttributesByIndex(attributes, attributeIndex, attributeStorageInfo, tilesetFields);
116
- }
117
- /**
118
- * Generates attribute object for feature mapping by feature id
119
- * @param {Array} attributes
120
- * @param {Number} featureIdIndex
121
- * @param {Object} attributeStorageInfo
122
- * @returns {Object}
123
- */
124
- function getFeatureAttributesByIndex(attributes, featureIdIndex, attributeStorageInfo, tilesetFields) {
125
- const attributesObject = {};
126
- for (let index = 0; index < attributeStorageInfo.length; index++) {
127
- const attributeName = attributeStorageInfo[index].name;
128
- const codedValues = getAttributeCodedValues(attributeName, tilesetFields);
129
- const attribute = getAttributeByIndexAndAttributeName(attributes, index, attributeName);
130
- attributesObject[attributeName] = formatAttributeValue(attribute, featureIdIndex, codedValues);
131
- }
132
- return attributesObject;
133
- }
134
- /**
135
- * Get coded values list from tileset.
136
- * @param attributeName
137
- * @param tilesetFields
138
- */
139
- function getAttributeCodedValues(attributeName, tilesetFields) {
140
- const attributeField = tilesetFields
141
- .find(field => field.name === attributeName || field.alias === attributeName);
142
- return attributeField?.domain?.codedValues || [];
143
- }
144
- /**
145
- * Return attribute value if it presents in atrributes list
146
- * @param {array} attributes
147
- * @param {number} index
148
- * @param {string} attributesName
149
- */
150
- function getAttributeByIndexAndAttributeName(attributes, index, attributesName) {
151
- const attributeObject = attributes[index];
152
- if (attributeObject.status === REJECTED_STATUS) {
153
- return null;
154
- }
155
- return attributeObject.value[attributesName];
156
- }
157
- /**
158
- * Do formatting of attribute values or return empty string.
159
- * @param {Array} attribute
160
- * @param {Number} featureIdIndex
161
- * @returns {String}
162
- */
163
- function formatAttributeValue(attribute, featureIdIndex, codedValues) {
164
- let value = EMPTY_VALUE;
165
- if (attribute && (featureIdIndex in attribute)) {
166
- // eslint-disable-next-line no-control-regex
167
- value = String(attribute[featureIdIndex]).replace(/\u0000|NaN/g, '').trim();
168
- }
169
- // Check if coded values are existed. If so we use them.
170
- if (codedValues.length) {
171
- const codeValue = codedValues.find(codedValue => codedValue.code === Number(value));
172
- value = codeValue?.name || EMPTY_VALUE;
173
- }
174
- return value;
175
- }
@@ -1,6 +0,0 @@
1
- import type { LoaderWithParser } from '@loaders.gl/loader-utils';
2
- /**
3
- * Loader for I3S - Building Scene Layer
4
- */
5
- export declare const I3SBuildingSceneLayerLoader: LoaderWithParser;
6
- //# sourceMappingURL=i3s-building-scene-layer-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-building-scene-layer-loader.d.ts","sourceRoot":"","sources":["../src/i3s-building-scene-layer-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAA+B,MAAM,0BAA0B,CAAC;AAS7F;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,gBASzC,CAAC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.I3SBuildingSceneLayerLoader = void 0;
4
- const parse_i3s_building_scene_layer_1 = require("./lib/parsers/parse-i3s-building-scene-layer");
5
- // __VERSION__ is injected by babel-plugin-version-inline
6
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';
8
- /**
9
- * Loader for I3S - Building Scene Layer
10
- */
11
- exports.I3SBuildingSceneLayerLoader = {
12
- name: 'I3S Building Scene Layer',
13
- id: 'i3s-building-scene-layer',
14
- module: 'i3s',
15
- version: VERSION,
16
- mimeTypes: ['application/json'],
17
- parse,
18
- extensions: ['json'],
19
- options: {}
20
- };
21
- async function parse(data, options, context) {
22
- if (!context?.url) {
23
- throw new Error('Url is not provided');
24
- }
25
- return (0, parse_i3s_building_scene_layer_1.parseBuildingSceneLayer)(data, context.url);
26
- }
@@ -1,6 +0,0 @@
1
- import type { LoaderWithParser } from '@loaders.gl/loader-utils';
2
- /**
3
- * Loader for I3S - Indexed 3D Scene Layer
4
- */
5
- export declare const I3SContentLoader: LoaderWithParser;
6
- //# sourceMappingURL=i3s-content-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-content-loader.d.ts","sourceRoot":"","sources":["../src/i3s-content-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAgB,MAAM,0BAA0B,CAAC;AAS9E;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAY9B,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.I3SContentLoader = void 0;
4
- const parse_i3s_tile_content_1 = require("./lib/parsers/parse-i3s-tile-content");
5
- // __VERSION__ is injected by babel-plugin-version-inline
6
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';
8
- /**
9
- * Loader for I3S - Indexed 3D Scene Layer
10
- */
11
- exports.I3SContentLoader = {
12
- name: 'I3S Content (Indexed Scene Layers)',
13
- id: 'i3s-content',
14
- module: 'i3s',
15
- worker: true,
16
- version: VERSION,
17
- mimeTypes: ['application/octet-stream'],
18
- parse,
19
- extensions: ['bin'],
20
- options: {
21
- 'i3s-content': {}
22
- }
23
- };
24
- async function parse(data, options, context) {
25
- const { tile, _tileOptions, tileset, _tilesetOptions } = options?.i3s || {};
26
- const tileOptions = _tileOptions || tile;
27
- const tilesetOptions = _tilesetOptions || tileset;
28
- if (!tileOptions || !tilesetOptions) {
29
- return null;
30
- }
31
- return await (0, parse_i3s_tile_content_1.parseI3STileContent)(data, tileOptions, tilesetOptions, options, context);
32
- }
@@ -1,11 +0,0 @@
1
- import type { LoaderWithParser } from '@loaders.gl/loader-utils';
2
- import { I3SParseOptions } from './types';
3
- import { LoaderOptions } from './../../loader-utils/src/types';
4
- export type I3SLoaderOptions = LoaderOptions & {
5
- i3s?: I3SParseOptions;
6
- };
7
- /**
8
- * Loader for I3S - Indexed 3D Scene Layer
9
- */
10
- export declare const I3SLoader: LoaderWithParser;
11
- //# sourceMappingURL=i3s-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-loader.d.ts","sourceRoot":"","sources":["../src/i3s-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAK/D,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAW7D,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAwBvB,CAAC"}
@@ -1,102 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.I3SLoader = void 0;
4
- const core_1 = require("@loaders.gl/core");
5
- const i3s_content_loader_1 = require("./i3s-content-loader");
6
- const parse_i3s_1 = require("./lib/parsers/parse-i3s");
7
- const constants_1 = require("./lib/parsers/constants");
8
- // __VERSION__ is injected by babel-plugin-version-inline
9
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
10
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
11
- const TILESET_REGEX = /layers\/[0-9]+$/;
12
- const TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
13
- const SLPK_HEX = '504b0304';
14
- const POINT_CLOUD = 'PointCloud';
15
- /**
16
- * Loader for I3S - Indexed 3D Scene Layer
17
- */
18
- exports.I3SLoader = {
19
- name: 'I3S (Indexed Scene Layers)',
20
- id: 'i3s',
21
- module: 'i3s',
22
- version: VERSION,
23
- mimeTypes: ['application/octet-stream'],
24
- parse: parseI3S,
25
- extensions: ['bin'],
26
- options: {
27
- i3s: {
28
- token: null,
29
- isTileset: 'auto',
30
- isTileHeader: 'auto',
31
- tile: null,
32
- tileset: null,
33
- _tileOptions: null,
34
- _tilesetOptions: null,
35
- useDracoGeometry: true,
36
- useCompressedTextures: true,
37
- decodeTextures: true,
38
- coordinateSystem: constants_1.COORDINATE_SYSTEM.METER_OFFSETS,
39
- colorsByAttribute: null
40
- }
41
- }
42
- };
43
- async function parseI3S(data, options = {}, context) {
44
- const url = context.url;
45
- options.i3s = options.i3s || {};
46
- const magicNumber = getMagicNumber(data);
47
- // check if file is slpk
48
- if (magicNumber === SLPK_HEX) {
49
- throw new Error('Files with .slpk extention currently are not supported by I3SLoader');
50
- }
51
- // auto detect file type based on url
52
- let isTileset;
53
- if (options.i3s.isTileset === 'auto') {
54
- isTileset = TILESET_REGEX.test(url);
55
- }
56
- else {
57
- isTileset = options.i3s.isTileset;
58
- }
59
- let isTileHeader;
60
- if (options.isTileHeader === 'auto') {
61
- isTileHeader = TILE_HEADER_REGEX.test(url);
62
- }
63
- else {
64
- isTileHeader = options.i3s.isTileHeader;
65
- }
66
- if (isTileset) {
67
- data = await parseTileset(data, options, context);
68
- }
69
- else if (isTileHeader) {
70
- data = await parseTile(data, context);
71
- }
72
- else {
73
- data = await parseTileContent(data, options);
74
- }
75
- return data;
76
- }
77
- async function parseTileContent(arrayBuffer, options) {
78
- return await (0, core_1.parse)(arrayBuffer, i3s_content_loader_1.I3SContentLoader, options);
79
- }
80
- async function parseTileset(data, options, context) {
81
- const tilesetJson = JSON.parse(new TextDecoder().decode(data));
82
- if (tilesetJson?.layerType === POINT_CLOUD) {
83
- throw new Error('Point Cloud layers currently are not supported by I3SLoader');
84
- }
85
- // eslint-disable-next-line no-use-before-define
86
- tilesetJson.loader = exports.I3SLoader;
87
- await (0, parse_i3s_1.normalizeTilesetData)(tilesetJson, options, context);
88
- return tilesetJson;
89
- }
90
- async function parseTile(data, context) {
91
- data = JSON.parse(new TextDecoder().decode(data));
92
- return (0, parse_i3s_1.normalizeTileData)(data, context);
93
- }
94
- function getMagicNumber(data) {
95
- if (data instanceof ArrayBuffer) {
96
- // slice binary data (4 bytes from the beginning) and transform it to hexadecimal numeral system
97
- return [...new Uint8Array(data, 0, 4)]
98
- .map((value) => value.toString(16).padStart(2, '0'))
99
- .join('');
100
- }
101
- return null;
102
- }
@@ -1,7 +0,0 @@
1
- import type { LoaderOptions, LoaderWithParser } from '@loaders.gl/loader-utils';
2
- import type { NodePage } from './types';
3
- /**
4
- * Loader for I3S node pages
5
- */
6
- export declare const I3SNodePageLoader: LoaderWithParser<NodePage, never, LoaderOptions>;
7
- //# sourceMappingURL=i3s-node-page-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-node-page-loader.d.ts","sourceRoot":"","sources":["../src/i3s-node-page-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC9E,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAUtC;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,CAS9E,CAAC"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.I3SNodePageLoader = void 0;
4
- // __VERSION__ is injected by babel-plugin-version-inline
5
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
6
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
7
- async function parseNodePage(data, options) {
8
- return JSON.parse(new TextDecoder().decode(data));
9
- }
10
- /**
11
- * Loader for I3S node pages
12
- */
13
- exports.I3SNodePageLoader = {
14
- name: 'I3S Node Page',
15
- id: 'i3s-node-page',
16
- module: 'i3s',
17
- version: VERSION,
18
- mimeTypes: ['application/json'],
19
- parse: parseNodePage,
20
- extensions: ['json'],
21
- options: {}
22
- };
@@ -1,13 +0,0 @@
1
- /// <reference types="node" />
2
- import { LoaderOptions, LoaderWithParser } from '@loaders.gl/loader-utils';
3
- export type SLPKLoaderOptions = LoaderOptions & {
4
- slpk?: {
5
- path?: string;
6
- pathMode?: 'http' | 'raw';
7
- };
8
- };
9
- /**
10
- * Loader for SLPK - Scene Layer Package
11
- */
12
- export declare const SLPKLoader: LoaderWithParser<Buffer, never, SLPKLoaderOptions>;
13
- //# sourceMappingURL=i3s-slpk-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-slpk-loader.d.ts","sourceRoot":"","sources":["../src/i3s-slpk-loader.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAOzE,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;KAC3B,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,iBAAiB,CASzE,CAAC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SLPKLoader = void 0;
4
- const parse_slpk_1 = require("./lib/parsers/parse-slpk/parse-slpk");
5
- // __VERSION__ is injected by babel-plugin-version-inline
6
- // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
8
- /**
9
- * Loader for SLPK - Scene Layer Package
10
- */
11
- exports.SLPKLoader = {
12
- name: 'I3S SLPK (Scene Layer Package)',
13
- id: 'slpk',
14
- module: 'i3s',
15
- version: VERSION,
16
- mimeTypes: ['application/octet-stream'],
17
- parse: parse_slpk_1.parseSLPK,
18
- extensions: ['slpk'],
19
- options: {}
20
- };
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- export type { BoundingVolumes, Mbs, Obb, SceneLayer3D, AttributeStorageInfo, Field, ESRIField, PopupInfo, Node3DIndexDocument, LodSelection, NodeReference, Resource, MaxScreenThresholdSQ, NodeInPage, SharedResources, Attribute, Extent, FeatureAttribute, FieldInfo, I3SMaterialDefinition, TextureDefinitionInfo, MaterialDefinitionInfo, FullExtent, StatisticsInfo, StatsInfo, Histogram, ValueCount, BuildingSceneSublayer, DATA_TYPE, OperationalLayer, TextureSetDefinitionFormats } from './types';
2
- export { COORDINATE_SYSTEM } from './lib/parsers/constants';
3
- export { I3SLoader } from './i3s-loader';
4
- export { SLPKLoader } from './i3s-slpk-loader';
5
- export { I3SContentLoader } from './i3s-content-loader';
6
- export { I3SAttributeLoader, loadFeatureAttributes } from './i3s-attribute-loader';
7
- export { I3SBuildingSceneLayerLoader } from './i3s-building-scene-layer-loader';
8
- export { I3SNodePageLoader } from './i3s-node-page-loader';
9
- export { ArcGisWebSceneLoader } from './arcgis-webscene-loader';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,eAAe,EACf,GAAG,EACH,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,KAAK,EACL,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,eAAe,EACf,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,SAAS,EACT,gBAAgB,EAChB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAC,kBAAkB,EAAE,qBAAqB,EAAC,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAC,2BAA2B,EAAC,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC"}
package/dist/index.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- // loaders.gl, MIT license
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ArcGisWebSceneLoader = exports.I3SNodePageLoader = exports.I3SBuildingSceneLayerLoader = exports.loadFeatureAttributes = exports.I3SAttributeLoader = exports.I3SContentLoader = exports.SLPKLoader = exports.I3SLoader = exports.COORDINATE_SYSTEM = void 0;
5
- var constants_1 = require("./lib/parsers/constants");
6
- Object.defineProperty(exports, "COORDINATE_SYSTEM", { enumerable: true, get: function () { return constants_1.COORDINATE_SYSTEM; } });
7
- var i3s_loader_1 = require("./i3s-loader");
8
- Object.defineProperty(exports, "I3SLoader", { enumerable: true, get: function () { return i3s_loader_1.I3SLoader; } });
9
- var i3s_slpk_loader_1 = require("./i3s-slpk-loader");
10
- Object.defineProperty(exports, "SLPKLoader", { enumerable: true, get: function () { return i3s_slpk_loader_1.SLPKLoader; } });
11
- var i3s_content_loader_1 = require("./i3s-content-loader");
12
- Object.defineProperty(exports, "I3SContentLoader", { enumerable: true, get: function () { return i3s_content_loader_1.I3SContentLoader; } });
13
- var i3s_attribute_loader_1 = require("./i3s-attribute-loader");
14
- Object.defineProperty(exports, "I3SAttributeLoader", { enumerable: true, get: function () { return i3s_attribute_loader_1.I3SAttributeLoader; } });
15
- Object.defineProperty(exports, "loadFeatureAttributes", { enumerable: true, get: function () { return i3s_attribute_loader_1.loadFeatureAttributes; } });
16
- var i3s_building_scene_layer_loader_1 = require("./i3s-building-scene-layer-loader");
17
- Object.defineProperty(exports, "I3SBuildingSceneLayerLoader", { enumerable: true, get: function () { return i3s_building_scene_layer_loader_1.I3SBuildingSceneLayerLoader; } });
18
- var i3s_node_page_loader_1 = require("./i3s-node-page-loader");
19
- Object.defineProperty(exports, "I3SNodePageLoader", { enumerable: true, get: function () { return i3s_node_page_loader_1.I3SNodePageLoader; } });
20
- var arcgis_webscene_loader_1 = require("./arcgis-webscene-loader");
21
- Object.defineProperty(exports, "ArcGisWebSceneLoader", { enumerable: true, get: function () { return arcgis_webscene_loader_1.ArcGisWebSceneLoader; } });
@@ -1 +0,0 @@
1
- {"version":3,"file":"i3s-nodepages-tiles.d.ts","sourceRoot":"","sources":["../../../src/lib/helpers/i3s-nodepages-tiles.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EACL,gBAAgB,EAEhB,QAAQ,EACR,UAAU,EAIV,gBAAgB,EAEhB,aAAa,EACd,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,SAAS,EAAE,QAAQ,EAAE,CAAM;IAC3B,gBAAgB,EAAE;QAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAA;KAAC,EAAE,CAAM;IAClF,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iCAAiC,EAAE,CAAC;QAAC,MAAM,EAAE,gBAAgB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,CAAC,EAAE,CAAM;IAC5F,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,oBAAoB,CAA4B;IAExD;;;;;OAKG;gBACS,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,aAAa;IAU7D;;;OAGG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAuBlD;;;OAGG;IAEG,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IA4D/D;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IA8BrB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;;;OAOG;IACH,OAAO,CAAC,0BAA0B;IAuBlC;;;;OAIG;IACH,OAAO,CAAC,wCAAwC;IA2BhD;;;OAGG;IACH,OAAO,CAAC,0BAA0B;CAwBnC"}