@loaders.gl/tile-converter 3.3.0-alpha.3 → 3.3.0-alpha.5

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 (107) hide show
  1. package/dist/3d-tiles-attributes-worker.d.ts +1 -1
  2. package/dist/3d-tiles-attributes-worker.js +2 -2
  3. package/dist/3d-tiles-attributes-worker.js.map +2 -2
  4. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts +8 -0
  5. package/dist/3d-tiles-converter/3d-tiles-converter.d.ts.map +1 -1
  6. package/dist/3d-tiles-converter/3d-tiles-converter.js +57 -43
  7. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts +5 -5
  8. package/dist/3d-tiles-converter/helpers/b3dm-converter.d.ts.map +1 -1
  9. package/dist/3d-tiles-converter/helpers/b3dm-converter.js +21 -17
  10. package/dist/converter.min.js +21 -21
  11. package/dist/deps-installer/deps-installer.d.ts +5 -1
  12. package/dist/deps-installer/deps-installer.d.ts.map +1 -1
  13. package/dist/deps-installer/deps-installer.js +21 -1
  14. package/dist/dist.min.js +662 -1018
  15. package/dist/es5/3d-tiles-attributes-worker.js +2 -2
  16. package/dist/es5/3d-tiles-attributes-worker.js.map +1 -1
  17. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +115 -101
  18. package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  19. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +27 -19
  20. package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  21. package/dist/es5/deps-installer/deps-installer.js +70 -6
  22. package/dist/es5/deps-installer/deps-installer.js.map +1 -1
  23. package/dist/es5/i3s-attributes-worker.js +1 -1
  24. package/dist/es5/i3s-attributes-worker.js.map +1 -1
  25. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +4 -0
  26. package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  27. package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  28. package/dist/es5/i3s-converter/helpers/feature-attributes.js +153 -0
  29. package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
  30. package/dist/es5/i3s-converter/helpers/geometry-converter.js +40 -44
  31. package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
  32. package/dist/es5/i3s-converter/helpers/gltf-attributes.js +55 -36
  33. package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  34. package/dist/es5/i3s-converter/helpers/node-pages.js +10 -2
  35. package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
  36. package/dist/es5/i3s-converter/i3s-converter.js +364 -435
  37. package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
  38. package/dist/es5/pgm-loader.js +1 -1
  39. package/dist/es5/workers/3d-tiles-attributes-worker.js +1 -1
  40. package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -1
  41. package/dist/esm/3d-tiles-attributes-worker.js +2 -2
  42. package/dist/esm/3d-tiles-attributes-worker.js.map +1 -1
  43. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js +59 -44
  44. package/dist/esm/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
  45. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js +25 -15
  46. package/dist/esm/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
  47. package/dist/esm/deps-installer/deps-installer.js +21 -2
  48. package/dist/esm/deps-installer/deps-installer.js.map +1 -1
  49. package/dist/esm/i3s-attributes-worker.js +1 -1
  50. package/dist/esm/i3s-attributes-worker.js.map +1 -1
  51. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +4 -0
  52. package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
  53. package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
  54. package/dist/esm/i3s-converter/helpers/feature-attributes.js +138 -0
  55. package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
  56. package/dist/esm/i3s-converter/helpers/geometry-converter.js +19 -21
  57. package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
  58. package/dist/esm/i3s-converter/helpers/gltf-attributes.js +55 -36
  59. package/dist/esm/i3s-converter/helpers/gltf-attributes.js.map +1 -1
  60. package/dist/esm/i3s-converter/helpers/node-pages.js +9 -2
  61. package/dist/esm/i3s-converter/helpers/node-pages.js.map +1 -1
  62. package/dist/esm/i3s-converter/i3s-converter.js +93 -183
  63. package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
  64. package/dist/esm/pgm-loader.js +1 -1
  65. package/dist/esm/workers/3d-tiles-attributes-worker.js +1 -1
  66. package/dist/esm/workers/3d-tiles-attributes-worker.js.map +1 -1
  67. package/dist/i3s-attributes-worker.d.ts +5 -1
  68. package/dist/i3s-attributes-worker.d.ts.map +1 -1
  69. package/dist/i3s-attributes-worker.js +3 -3
  70. package/dist/i3s-attributes-worker.js.map +2 -2
  71. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +2 -3
  72. package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
  73. package/dist/i3s-converter/helpers/batch-ids-extensions.js +3 -0
  74. package/dist/i3s-converter/helpers/coordinate-converter.d.ts +2 -2
  75. package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
  76. package/dist/i3s-converter/helpers/feature-attributes.d.ts +32 -0
  77. package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
  78. package/dist/i3s-converter/helpers/feature-attributes.js +162 -1
  79. package/dist/i3s-converter/helpers/geometry-converter.d.ts +5 -4
  80. package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
  81. package/dist/i3s-converter/helpers/geometry-converter.js +29 -27
  82. package/dist/i3s-converter/helpers/gltf-attributes.d.ts.map +1 -1
  83. package/dist/i3s-converter/helpers/gltf-attributes.js +50 -30
  84. package/dist/i3s-converter/helpers/node-pages.d.ts +4 -0
  85. package/dist/i3s-converter/helpers/node-pages.d.ts.map +1 -1
  86. package/dist/i3s-converter/helpers/node-pages.js +9 -2
  87. package/dist/i3s-converter/i3s-converter.d.ts +24 -48
  88. package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
  89. package/dist/i3s-converter/i3s-converter.js +88 -186
  90. package/dist/i3s-converter/types.d.ts +4 -0
  91. package/dist/i3s-converter/types.d.ts.map +1 -1
  92. package/dist/workers/3d-tiles-attributes-worker.js +1 -1
  93. package/package.json +15 -15
  94. package/src/3d-tiles-attributes-worker.ts +1 -1
  95. package/src/3d-tiles-converter/3d-tiles-converter.ts +71 -55
  96. package/src/3d-tiles-converter/helpers/b3dm-converter.ts +25 -18
  97. package/src/deps-installer/deps-installer.ts +29 -2
  98. package/src/i3s-attributes-worker.ts +5 -1
  99. package/src/i3s-converter/helpers/batch-ids-extensions.ts +13 -6
  100. package/src/i3s-converter/helpers/coordinate-converter.ts +2 -2
  101. package/src/i3s-converter/helpers/feature-attributes.ts +182 -0
  102. package/src/i3s-converter/helpers/geometry-converter.ts +45 -36
  103. package/src/i3s-converter/helpers/gltf-attributes.ts +54 -33
  104. package/src/i3s-converter/helpers/node-pages.ts +10 -2
  105. package/src/i3s-converter/i3s-converter.ts +125 -210
  106. package/src/i3s-converter/types.ts +4 -0
  107. package/src/workers/3d-tiles-attributes-worker.ts +1 -1
@@ -1,10 +1,19 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.flattenPropertyTableByFeatureIds = flattenPropertyTableByFeatureIds;
7
9
  exports.checkPropertiesLength = checkPropertiesLength;
10
+ exports.getAttributeType = getAttributeType;
11
+ exports.createdStorageAttribute = createdStorageAttribute;
12
+ exports.getFieldAttributeType = getFieldAttributeType;
13
+ exports.createFieldAttribute = createFieldAttribute;
14
+ exports.createPopupInfo = createPopupInfo;
15
+
16
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
8
17
 
9
18
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
19
 
@@ -57,4 +66,148 @@ function checkPropertiesLength(featureIds, propertyTable) {
57
66
 
58
67
  return needFlatten;
59
68
  }
69
+
70
+ var STRING_TYPE = 'string';
71
+ var SHORT_INT_TYPE = 'Int32';
72
+ var DOUBLE_TYPE = 'double';
73
+ var OBJECT_ID_TYPE = 'OBJECTID';
74
+
75
+ function getAttributeType(key, attribute) {
76
+ if (key === OBJECT_ID_TYPE) {
77
+ return OBJECT_ID_TYPE;
78
+ }
79
+
80
+ if ((0, _typeof2.default)(attribute) === STRING_TYPE) {
81
+ return STRING_TYPE;
82
+ } else if (typeof attribute === 'number') {
83
+ return Number.isInteger(attribute) ? SHORT_INT_TYPE : DOUBLE_TYPE;
84
+ }
85
+
86
+ return STRING_TYPE;
87
+ }
88
+
89
+ function createdStorageAttribute(attributeIndex, key, attributeType) {
90
+ var storageAttribute = {
91
+ key: "f_".concat(attributeIndex),
92
+ name: key,
93
+ ordering: ['attributeValues'],
94
+ header: [{
95
+ property: 'count',
96
+ valueType: 'UInt32'
97
+ }],
98
+ attributeValues: {
99
+ valueType: 'Int32',
100
+ valuesPerElement: 1
101
+ }
102
+ };
103
+
104
+ switch (attributeType) {
105
+ case OBJECT_ID_TYPE:
106
+ setupIdAttribute(storageAttribute);
107
+ break;
108
+
109
+ case STRING_TYPE:
110
+ setupStringAttribute(storageAttribute);
111
+ break;
112
+
113
+ case DOUBLE_TYPE:
114
+ setupDoubleAttribute(storageAttribute);
115
+ break;
116
+
117
+ case SHORT_INT_TYPE:
118
+ break;
119
+
120
+ default:
121
+ setupStringAttribute(storageAttribute);
122
+ }
123
+
124
+ return storageAttribute;
125
+ }
126
+
127
+ function getFieldAttributeType(attributeType) {
128
+ switch (attributeType) {
129
+ case OBJECT_ID_TYPE:
130
+ return 'esriFieldTypeOID';
131
+
132
+ case STRING_TYPE:
133
+ return 'esriFieldTypeString';
134
+
135
+ case SHORT_INT_TYPE:
136
+ return 'esriFieldTypeInteger';
137
+
138
+ case DOUBLE_TYPE:
139
+ return 'esriFieldTypeDouble';
140
+
141
+ default:
142
+ return 'esriFieldTypeString';
143
+ }
144
+ }
145
+
146
+ function createFieldAttribute(key, fieldAttributeType) {
147
+ return {
148
+ name: key,
149
+ type: fieldAttributeType,
150
+ alias: key
151
+ };
152
+ }
153
+
154
+ function createPopupInfo(propertyTable) {
155
+ var title = '{OBJECTID}';
156
+ var mediaInfos = [];
157
+ var fieldInfos = [];
158
+ var popupElements = [];
159
+ var expressionInfos = [];
160
+
161
+ for (var key in propertyTable) {
162
+ fieldInfos.push({
163
+ fieldName: key,
164
+ visible: true,
165
+ isEditable: false,
166
+ label: key
167
+ });
168
+ }
169
+
170
+ popupElements.push({
171
+ fieldInfos: fieldInfos,
172
+ type: 'fields'
173
+ });
174
+ return {
175
+ title: title,
176
+ mediaInfos: mediaInfos,
177
+ popupElements: popupElements,
178
+ fieldInfos: fieldInfos,
179
+ expressionInfos: expressionInfos
180
+ };
181
+ }
182
+
183
+ function setupStringAttribute(storageAttribute) {
184
+ storageAttribute.ordering.unshift('attributeByteCounts');
185
+ storageAttribute.header.push({
186
+ property: 'attributeValuesByteCount',
187
+ valueType: 'UInt32'
188
+ });
189
+ storageAttribute.attributeValues = {
190
+ valueType: 'String',
191
+ encoding: 'UTF-8',
192
+ valuesPerElement: 1
193
+ };
194
+ storageAttribute.attributeByteCounts = {
195
+ valueType: 'UInt32',
196
+ valuesPerElement: 1
197
+ };
198
+ }
199
+
200
+ function setupIdAttribute(storageAttribute) {
201
+ storageAttribute.attributeValues = {
202
+ valueType: 'Oid32',
203
+ valuesPerElement: 1
204
+ };
205
+ }
206
+
207
+ function setupDoubleAttribute(storageAttribute) {
208
+ storageAttribute.attributeValues = {
209
+ valueType: 'Float64',
210
+ valuesPerElement: 1
211
+ };
212
+ }
60
213
  //# sourceMappingURL=feature-attributes.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/i3s-converter/helpers/feature-attributes.ts"],"names":["flattenPropertyTableByFeatureIds","featureIds","propertyTable","resultPropertyTable","propertyName","properties","getPropertiesByFeatureIds","resultProperties","featureId","property","push","checkPropertiesLength","needFlatten","Object","values","attribute","length"],"mappings":";;;;;;;;;;;;;;AAeO,SAASA,gCAAT,CACLC,UADK,EAELC,aAFK,EAGa;AAClB,MAAMC,mBAAqC,GAAG,EAA9C;;AACA,OAAK,IAAMC,YAAX,IAA2BF,aAA3B,EAA0C;AACxC,QAAMG,UAAU,GAAGH,aAAa,CAACE,YAAD,CAAhC;AACAD,IAAAA,mBAAmB,CAACC,YAAD,CAAnB,GAAoCE,yBAAyB,CAACD,UAAD,EAAaJ,UAAb,CAA7D;AACD;;AAED,SAAOE,mBAAP;AACD;;AAOD,SAASG,yBAAT,CAAmCD,UAAnC,EAAsDJ,UAAtD,EAAmF;AACjF,MAAMM,gBAAqB,GAAG,EAA9B;;AADiF,6CAGzDN,UAHyD;AAAA;;AAAA;AAGjF,wDAAoC;AAAA,UAAzBO,SAAyB;AAClC,UAAMC,QAAQ,GAAGJ,UAAU,CAACG,SAAD,CAAV,IAAyB,IAA1C;AACAD,MAAAA,gBAAgB,CAACG,IAAjB,CAAsBD,QAAtB;AACD;AANgF;AAAA;AAAA;AAAA;AAAA;;AAQjF,SAAOF,gBAAP;AACD;;AASM,SAASI,qBAAT,CACLV,UADK,EAELC,aAFK,EAGI;AACT,MAAIU,WAAW,GAAG,KAAlB;;AAEA,oCAAwBC,MAAM,CAACC,MAAP,CAAcZ,aAAd,CAAxB,oCAAsD;AAAjD,QAAMa,SAAS,qBAAf;;AACH,QAAId,UAAU,CAACe,MAAX,KAAsBD,SAAS,CAACC,MAApC,EAA4C;AAC1CJ,MAAAA,WAAW,GAAG,IAAd;AACD;AACF;;AAED,SAAOA,WAAP;AACD","sourcesContent":["import type {FeatureTableJson} from '@loaders.gl/3d-tiles';\n\n/**\n * Takes attributes from property table based on featureIds.\n * If there is no property value for particular featureId (index) the property will be null.\n * Example:\n * Initial data:\n * OBJECTID: [0, 1, 5]\n * component: ['Windows', 'Frames', 'Wall', 'Roof', 'Skylight']\n * Result:\n * OBJECTID: [0, 1, 5]\n * component: ['Windows', 'Frames', 'null']\n * @param featureIds\n * @param propertyTable\n */\nexport function flattenPropertyTableByFeatureIds(\n featureIds: number[],\n propertyTable: FeatureTableJson\n): FeatureTableJson {\n const resultPropertyTable: FeatureTableJson = {};\n for (const propertyName in propertyTable) {\n const properties = propertyTable[propertyName];\n resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIds);\n }\n\n return resultPropertyTable;\n}\n\n/**\n * Getting properties by featureId index\n * @param properties\n * @param featureIds\n */\nfunction getPropertiesByFeatureIds(properties: any[], featureIds: number[]): any[] {\n const resultProperties: any = [];\n\n for (const featureId of featureIds) {\n const property = properties[featureId] || null;\n resultProperties.push(property);\n }\n\n return resultProperties;\n}\n\n/**\n * Check that all attributes in propertyTable have the same length as FeatureIds.\n * If there are differencies between lengths we should flatten property table based on exiesting featureIds.\n * @param featureIds\n * @param propertyTable\n * @returns\n */\nexport function checkPropertiesLength(\n featureIds: number[],\n propertyTable: FeatureTableJson\n): boolean {\n let needFlatten = false;\n\n for (const attribute of Object.values(propertyTable)) {\n if (featureIds.length !== attribute.length) {\n needFlatten = true;\n }\n }\n\n return needFlatten;\n}\n"],"file":"feature-attributes.js"}
1
+ {"version":3,"sources":["../../../../src/i3s-converter/helpers/feature-attributes.ts"],"names":["flattenPropertyTableByFeatureIds","featureIds","propertyTable","resultPropertyTable","propertyName","properties","getPropertiesByFeatureIds","resultProperties","featureId","property","push","checkPropertiesLength","needFlatten","Object","values","attribute","length","STRING_TYPE","SHORT_INT_TYPE","DOUBLE_TYPE","OBJECT_ID_TYPE","getAttributeType","key","Number","isInteger","createdStorageAttribute","attributeIndex","attributeType","storageAttribute","name","ordering","header","valueType","attributeValues","valuesPerElement","setupIdAttribute","setupStringAttribute","setupDoubleAttribute","getFieldAttributeType","createFieldAttribute","fieldAttributeType","type","alias","createPopupInfo","title","mediaInfos","fieldInfos","popupElements","expressionInfos","fieldName","visible","isEditable","label","unshift","encoding","attributeByteCounts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBO,SAASA,gCAAT,CACLC,UADK,EAELC,aAFK,EAGa;AAClB,MAAMC,mBAAqC,GAAG,EAA9C;;AACA,OAAK,IAAMC,YAAX,IAA2BF,aAA3B,EAA0C;AACxC,QAAMG,UAAU,GAAGH,aAAa,CAACE,YAAD,CAAhC;AACAD,IAAAA,mBAAmB,CAACC,YAAD,CAAnB,GAAoCE,yBAAyB,CAACD,UAAD,EAAaJ,UAAb,CAA7D;AACD;;AAED,SAAOE,mBAAP;AACD;;AAOD,SAASG,yBAAT,CAAmCD,UAAnC,EAAsDJ,UAAtD,EAAmF;AACjF,MAAMM,gBAAqB,GAAG,EAA9B;;AADiF,6CAGzDN,UAHyD;AAAA;;AAAA;AAGjF,wDAAoC;AAAA,UAAzBO,SAAyB;AAClC,UAAMC,QAAQ,GAAGJ,UAAU,CAACG,SAAD,CAAV,IAAyB,IAA1C;AACAD,MAAAA,gBAAgB,CAACG,IAAjB,CAAsBD,QAAtB;AACD;AANgF;AAAA;AAAA;A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l/3d-tiles';\nimport {\n Attribute,\n AttributeStorageInfo,\n ESRIField,\n Field,\n FieldInfo,\n PopupInfo\n} from '@loaders.gl/i3s';\n\n/**\n * Takes attributes from property table based on featureIds.\n * If there is no property value for particular featureId (index) the property will be null.\n * Example:\n * Initial data:\n * OBJECTID: [0, 1, 5]\n * component: ['Windows', 'Frames', 'Wall', 'Roof', 'Skylight']\n * Result:\n * OBJECTID: [0, 1, 5]\n * component: ['Windows', 'Frames', 'null']\n * @param featureIds\n * @param propertyTable\n */\nexport function flattenPropertyTableByFeatureIds(\n featureIds: number[],\n propertyTable: FeatureTableJson\n): FeatureTableJson {\n const resultPropertyTable: FeatureTableJson = {};\n for (const propertyName in propertyTable) {\n const properties = propertyTable[propertyName];\n resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIds);\n }\n\n return resultPropertyTable;\n}\n\n/**\n * Getting properties by featureId index\n * @param properties\n * @param featureIds\n */\nfunction getPropertiesByFeatureIds(properties: any[], featureIds: number[]): any[] {\n const resultProperties: any = [];\n\n for (const featureId of featureIds) {\n const property = properties[featureId] || null;\n resultProperties.push(property);\n }\n\n return resultProperties;\n}\n\n/**\n * Check that all attributes in propertyTable have the same length as FeatureIds.\n * If there are differencies between lengths we should flatten property table based on exiesting featureIds.\n * @param featureIds\n * @param propertyTable\n * @returns\n */\nexport function checkPropertiesLength(\n featureIds: number[],\n propertyTable: FeatureTableJson\n): boolean {\n let needFlatten = false;\n\n for (const attribute of Object.values(propertyTable)) {\n if (featureIds.length !== attribute.length) {\n needFlatten = true;\n }\n }\n\n return needFlatten;\n}\n\n/** String data type name for feature attributes */\nconst STRING_TYPE = 'string';\n/** Integer data type name for feature attributes */\nconst SHORT_INT_TYPE = 'Int32';\n/** Double data type name for feature attributes */\nconst DOUBLE_TYPE = 'double';\n/** Type of attribute that is linked with feature ids */\nconst OBJECT_ID_TYPE = 'OBJECTID';\n/**\n * Get the attribute type for attributeStorageInfo https://github.com/Esri/i3s-spec/blob/master/docs/1.7/attributeStorageInfo.cmn.md\n * @param key - attribute's key\n * @param attribute - attribute's type in propertyTable\n */\nexport function getAttributeType(key: string, attribute: string): string {\n if (key === OBJECT_ID_TYPE) {\n return OBJECT_ID_TYPE;\n }\n if (typeof attribute === STRING_TYPE) {\n return STRING_TYPE;\n } else if (typeof attribute === 'number') {\n return Number.isInteger(attribute) ? SHORT_INT_TYPE : DOUBLE_TYPE;\n }\n return STRING_TYPE;\n}\n\n/**\n * Generate storage attribute for map segmentation.\n * @param attributeIndex - order index of attribute (f_0, f_1 ...).\n * @param key - attribute key from propertyTable.\n * @param attributeType - attribute type.\n * @return Updated storageAttribute.\n */\nexport function createdStorageAttribute(\n attributeIndex: number,\n key: string,\n attributeType: Attribute\n): AttributeStorageInfo {\n const storageAttribute = {\n key: `f_${attributeIndex}`,\n name: key,\n ordering: ['attributeValues'],\n header: [{property: 'count', valueType: 'UInt32'}],\n attributeValues: {valueType: 'Int32', valuesPerElement: 1}\n };\n\n switch (attributeType) {\n case OBJECT_ID_TYPE:\n setupIdAttribute(storageAttribute);\n break;\n case STRING_TYPE:\n setupStringAttribute(storageAttribute);\n break;\n case DOUBLE_TYPE:\n setupDoubleAttribute(storageAttribute);\n break;\n case SHORT_INT_TYPE:\n break;\n default:\n setupStringAttribute(storageAttribute);\n }\n\n return storageAttribute;\n}\n\n/**\n * Find and return attribute type based on key form propertyTable.\n * @param attributeType\n */\nexport function getFieldAttributeType(attributeType: Attribute): ESRIField {\n switch (attributeType) {\n case OBJECT_ID_TYPE:\n return 'esriFieldTypeOID';\n case STRING_TYPE:\n return 'esriFieldTypeString';\n case SHORT_INT_TYPE:\n return 'esriFieldTypeInteger';\n case DOUBLE_TYPE:\n return 'esriFieldTypeDouble';\n default:\n return 'esriFieldTypeString';\n }\n}\n\n/**\n * Setup field attribute for map segmentation.\n * @param key - attribute for map segmentation.\n * @param fieldAttributeType - esri attribute type ('esriFieldTypeString' or 'esriFieldTypeOID').\n */\nexport function createFieldAttribute(key: string, fieldAttributeType: ESRIField): Field {\n return {\n name: key,\n type: fieldAttributeType,\n alias: key\n };\n}\n\n/**\n * Generate popup info to show metadata on the map.\n * @param propertyTable - table data with OBJECTID.\n * @return data for correct rendering of popup.\n */\nexport function createPopupInfo(propertyTable: FeatureTableJson): PopupInfo {\n const title = '{OBJECTID}';\n const mediaInfos = [];\n const fieldInfos: FieldInfo[] = [];\n const popupElements: {\n fieldInfos: FieldInfo[];\n type: string;\n }[] = [];\n const expressionInfos = [];\n\n for (const key in propertyTable) {\n fieldInfos.push({\n fieldName: key,\n visible: true,\n isEditable: false,\n label: key\n });\n }\n popupElements.push({\n fieldInfos,\n type: 'fields'\n });\n\n return {\n title,\n mediaInfos,\n popupElements,\n fieldInfos,\n expressionInfos\n };\n}\n\n/**\n * Setup storage attribute as string.\n * @param storageAttribute - attribute for map segmentation.\n */\nfunction setupStringAttribute(storageAttribute: AttributeStorageInfo): void {\n // @ts-expect-error\n storageAttribute.ordering.unshift('attributeByteCounts');\n storageAttribute.header.push({property: 'attributeValuesByteCount', valueType: 'UInt32'});\n storageAttribute.attributeValues = {\n valueType: 'String',\n encoding: 'UTF-8',\n valuesPerElement: 1\n };\n storageAttribute.attributeByteCounts = {\n valueType: 'UInt32',\n valuesPerElement: 1\n };\n}\n\n/**\n * Setup Id attribute for map segmentation.\n * @param storageAttribute - attribute for map segmentation .\n */\nfunction setupIdAttribute(storageAttribute: AttributeStorageInfo): void {\n storageAttribute.attributeValues = {\n valueType: 'Oid32',\n valuesPerElement: 1\n };\n}\n\n/**\n * Setup double attribute for map segmentation.\n * @param storageAttribute - attribute for map segmentation .\n */\nfunction setupDoubleAttribute(storageAttribute: AttributeStorageInfo): void {\n storageAttribute.attributeValues = {\n valueType: 'Float64',\n valuesPerElement: 1\n };\n}\n"],"file":"feature-attributes.js"}
@@ -66,17 +66,17 @@ function convertB3dmToI3sGeometry(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9) {
66
66
  }
67
67
 
68
68
  function _convertB3dmToI3sGeometry() {
69
- _convertB3dmToI3sGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tileContent, nodeId, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
70
- var _tileContent$gltf;
69
+ _convertB3dmToI3sGeometry = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(tileContent, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, geoidHeightModel, workerSource) {
70
+ var _tileContent$gltf4;
71
71
 
72
- var useCartesianPositions, materialAndTextureList, dataForAttributesConversion, convertedAttributesMap, result, nodesCounter, _ref3, _ref3$materials, materials, i, sourceMaterial, convertedAttributes, _materialAndTextureLi, material, texture;
72
+ var useCartesianPositions, materialAndTextureList, dataForAttributesConversion, convertedAttributesMap, result, _ref3, _ref3$materials, materials, i, sourceMaterial, convertedAttributes, _materialAndTextureLi, material, texture, nodeId;
73
73
 
74
74
  return _regenerator.default.wrap(function _callee$(_context) {
75
75
  while (1) {
76
76
  switch (_context.prev = _context.next) {
77
77
  case 0:
78
78
  useCartesianPositions = generateBoundingVolumes;
79
- materialAndTextureList = convertMaterials((_tileContent$gltf = tileContent.gltf) === null || _tileContent$gltf === void 0 ? void 0 : _tileContent$gltf.materials);
79
+ materialAndTextureList = convertMaterials((_tileContent$gltf4 = tileContent.gltf) === null || _tileContent$gltf4 === void 0 ? void 0 : _tileContent$gltf4.materials);
80
80
  dataForAttributesConversion = (0, _gltfAttributes.prepareDataForAttributesConversion)(tileContent);
81
81
  _context.next = 5;
82
82
  return convertAttributes(dataForAttributesConversion, useCartesianPositions);
@@ -95,7 +95,6 @@ function _convertB3dmToI3sGeometry() {
95
95
  }
96
96
 
97
97
  result = [];
98
- nodesCounter = nodeId;
99
98
  _ref3 = tileContent.gltf || {
100
99
  materials: []
101
100
  }, _ref3$materials = _ref3.materials, materials = _ref3$materials === void 0 ? [] : _ref3$materials;
@@ -108,33 +107,34 @@ function _convertB3dmToI3sGeometry() {
108
107
 
109
108
  i = 0;
110
109
 
111
- case 13:
110
+ case 12:
112
111
  if (!(i < materials.length)) {
113
- _context.next = 30;
112
+ _context.next = 29;
114
113
  break;
115
114
  }
116
115
 
117
116
  sourceMaterial = materials[i];
118
117
 
119
118
  if (convertedAttributesMap.has(sourceMaterial.id)) {
120
- _context.next = 17;
119
+ _context.next = 16;
121
120
  break;
122
121
  }
123
122
 
124
- return _context.abrupt("continue", 27);
123
+ return _context.abrupt("continue", 26);
125
124
 
126
- case 17:
125
+ case 16:
127
126
  convertedAttributes = convertedAttributesMap.get(sourceMaterial.id);
128
127
 
129
128
  if (convertedAttributes) {
130
- _context.next = 20;
129
+ _context.next = 19;
131
130
  break;
132
131
  }
133
132
 
134
- return _context.abrupt("continue", 27);
133
+ return _context.abrupt("continue", 26);
135
134
 
136
- case 20:
135
+ case 19:
137
136
  _materialAndTextureLi = materialAndTextureList[i], material = _materialAndTextureLi.material, texture = _materialAndTextureLi.texture;
137
+ nodeId = addNodeToNodePage();
138
138
  _context.t0 = result;
139
139
  _context.next = 24;
140
140
  return _makeNodeResources({
@@ -142,7 +142,7 @@ function _convertB3dmToI3sGeometry() {
142
142
  material: material,
143
143
  texture: texture,
144
144
  tileContent: tileContent,
145
- nodeId: nodesCounter,
145
+ nodeId: nodeId,
146
146
  featuresHashArray: featuresHashArray,
147
147
  propertyTable: propertyTable,
148
148
  attributeStorageInfo: attributeStorageInfo,
@@ -155,25 +155,23 @@ function _convertB3dmToI3sGeometry() {
155
155
 
156
156
  _context.t0.push.call(_context.t0, _context.t1);
157
157
 
158
- nodesCounter++;
159
-
160
- case 27:
158
+ case 26:
161
159
  i++;
162
- _context.next = 13;
160
+ _context.next = 12;
163
161
  break;
164
162
 
165
- case 30:
163
+ case 29:
166
164
  if (result.length) {
167
- _context.next = 32;
165
+ _context.next = 31;
168
166
  break;
169
167
  }
170
168
 
171
169
  return _context.abrupt("return", null);
172
170
 
173
- case 32:
171
+ case 31:
174
172
  return _context.abrupt("return", result);
175
173
 
176
- case 33:
174
+ case 32:
177
175
  case "end":
178
176
  return _context.stop();
179
177
  }
@@ -217,7 +215,7 @@ function _makeNodeResources(_x10) {
217
215
 
218
216
  function _makeNodeResources2() {
219
217
  _makeNodeResources2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(_ref) {
220
- var _tileContent$gltf2;
218
+ var _tileContent$gltf5;
221
219
 
222
220
  var convertedAttributes, material, texture, tileContent, nodeId, featuresHashArray, propertyTable, attributeStorageInfo, draco, workerSource, boundingVolumes, vertexCount, _generateAttributes, faceRange, featureIds, positions, normals, colors, texCoords, featureCount, header, typedFeatureIds, fileBuffer, compressedGeometry, attributes;
223
221
 
@@ -253,10 +251,11 @@ function _makeNodeResources2() {
253
251
  }
254
252
 
255
253
  return _context2.abrupt("return", {
254
+ nodeId: nodeId,
256
255
  geometry: fileBuffer,
257
256
  compressedGeometry: compressedGeometry,
258
257
  texture: texture,
259
- sharedResources: getSharedResources(((_tileContent$gltf2 = tileContent.gltf) === null || _tileContent$gltf2 === void 0 ? void 0 : _tileContent$gltf2.materials) || [], nodeId),
258
+ sharedResources: getSharedResources(((_tileContent$gltf5 = tileContent.gltf) === null || _tileContent$gltf5 === void 0 ? void 0 : _tileContent$gltf5.materials) || [], nodeId),
260
259
  meshMaterial: material,
261
260
  vertexCount: vertexCount,
262
261
  attributes: attributes,
@@ -280,13 +279,13 @@ function convertAttributes(_x11, _x12) {
280
279
 
281
280
  function _convertAttributes() {
282
281
  _convertAttributes = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3(attributesData, useCartesianPositions) {
283
- var gltfMaterials, nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, _iterator7, _step7, material, _iterator8, _step8, attrKey, attributes;
282
+ var gltfMaterials, nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, _iterator7, _step7, material, _iterator8, _step8, attrKey, attributes;
284
283
 
285
284
  return _regenerator.default.wrap(function _callee3$(_context3) {
286
285
  while (1) {
287
286
  switch (_context3.prev = _context3.next) {
288
287
  case 0:
289
- gltfMaterials = attributesData.gltfMaterials, nodes = attributesData.nodes, cartographicOrigin = attributesData.cartographicOrigin, cartesianModelMatrix = attributesData.cartesianModelMatrix;
288
+ gltfMaterials = attributesData.gltfMaterials, nodes = attributesData.nodes, images = attributesData.images, cartographicOrigin = attributesData.cartographicOrigin, cartesianModelMatrix = attributesData.cartesianModelMatrix;
290
289
  attributesMap = new Map();
291
290
  _iterator7 = _createForOfIteratorHelper(gltfMaterials || [{
292
291
  id: 'default'
@@ -311,7 +310,7 @@ function _convertAttributes() {
311
310
  _iterator7.f();
312
311
  }
313
312
 
314
- convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions);
313
+ convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions);
315
314
  _iterator8 = _createForOfIteratorHelper(attributesMap.keys());
316
315
  _context3.prev = 6;
317
316
 
@@ -384,8 +383,8 @@ function _convertAttributes() {
384
383
  return _convertAttributes.apply(this, arguments);
385
384
  }
386
385
 
387
- function convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
388
- var matrix = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
386
+ function convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
387
+ var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
389
388
 
390
389
  if (nodes) {
391
390
  var _iterator2 = _createForOfIteratorHelper(nodes),
@@ -394,7 +393,7 @@ function convertNodes(nodes, cartographicOrigin, cartesianModelMatrix, attribute
394
393
  try {
395
394
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
396
395
  var node = _step2.value;
397
- convertNode(node, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix);
396
+ convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix);
398
397
  }
399
398
  } catch (err) {
400
399
  _iterator2.e(err);
@@ -430,17 +429,16 @@ function getCompositeTransformationMatrix(node, matrix) {
430
429
  return transformationMatrix;
431
430
  }
432
431
 
433
- function convertNode(node, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
434
- var matrix = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
432
+ function convertNode(node, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions) {
433
+ var matrix = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new _core.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);
435
434
  var transformationMatrix = getCompositeTransformationMatrix(node, matrix);
436
435
  var mesh = node.mesh;
437
- var images = node.images;
438
436
 
439
437
  if (mesh) {
440
438
  convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
441
439
  }
442
440
 
443
- convertNodes(node.children || [], cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
441
+ convertNodes(node.children || [], images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix);
444
442
  }
445
443
 
446
444
  function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap) {
@@ -1053,16 +1051,14 @@ function generateFeatureIndexAttribute(featureIndex, faceRange) {
1053
1051
  return orderedFeatureIndices;
1054
1052
  }
1055
1053
 
1056
- function getPropertyTable(sourceTile) {
1057
- var _sourceTile$content;
1058
-
1059
- var batchTableJson = sourceTile === null || sourceTile === void 0 ? void 0 : (_sourceTile$content = sourceTile.content) === null || _sourceTile$content === void 0 ? void 0 : _sourceTile$content.batchTableJson;
1054
+ function getPropertyTable(tileContent) {
1055
+ var batchTableJson = tileContent === null || tileContent === void 0 ? void 0 : tileContent.batchTableJson;
1060
1056
 
1061
1057
  if (batchTableJson) {
1062
1058
  return batchTableJson;
1063
1059
  }
1064
1060
 
1065
- var _getPropertyTableExte = getPropertyTableExtension(sourceTile),
1061
+ var _getPropertyTableExte = getPropertyTableExtension(tileContent),
1066
1062
  extensionName = _getPropertyTableExte.extensionName,
1067
1063
  extension = _getPropertyTableExte.extension;
1068
1064
 
@@ -1083,11 +1079,11 @@ function getPropertyTable(sourceTile) {
1083
1079
  }
1084
1080
  }
1085
1081
 
1086
- function getPropertyTableExtension(sourceTile) {
1087
- var _sourceTile$content2, _sourceTile$content2$, _sourceTile$content3, _sourceTile$content3$, _sourceTile$content3$2, _sourceTile$content4, _sourceTile$content4$;
1082
+ function getPropertyTableExtension(tileContent) {
1083
+ var _tileContent$gltf, _tileContent$gltf2, _tileContent$gltf2$ex, _tileContent$gltf3;
1088
1084
 
1089
1085
  var extensionsWithPropertyTables = [EXT_FEATURE_METADATA, EXT_MESH_FEATURES];
1090
- var extensionsUsed = sourceTile === null || sourceTile === void 0 ? void 0 : (_sourceTile$content2 = sourceTile.content) === null || _sourceTile$content2 === void 0 ? void 0 : (_sourceTile$content2$ = _sourceTile$content2.gltf) === null || _sourceTile$content2$ === void 0 ? void 0 : _sourceTile$content2$.extensionsUsed;
1086
+ var extensionsUsed = tileContent === null || tileContent === void 0 ? void 0 : (_tileContent$gltf = tileContent.gltf) === null || _tileContent$gltf === void 0 ? void 0 : _tileContent$gltf.extensionsUsed;
1091
1087
 
1092
1088
  if (!extensionsUsed) {
1093
1089
  return {
@@ -1098,7 +1094,7 @@ function getPropertyTableExtension(sourceTile) {
1098
1094
 
1099
1095
  var extensionName = '';
1100
1096
 
1101
- var _iterator6 = _createForOfIteratorHelper(sourceTile === null || sourceTile === void 0 ? void 0 : (_sourceTile$content4 = sourceTile.content) === null || _sourceTile$content4 === void 0 ? void 0 : (_sourceTile$content4$ = _sourceTile$content4.gltf) === null || _sourceTile$content4$ === void 0 ? void 0 : _sourceTile$content4$.extensionsUsed),
1097
+ var _iterator6 = _createForOfIteratorHelper((tileContent === null || tileContent === void 0 ? void 0 : (_tileContent$gltf3 = tileContent.gltf) === null || _tileContent$gltf3 === void 0 ? void 0 : _tileContent$gltf3.extensionsUsed) || []),
1102
1098
  _step6;
1103
1099
 
1104
1100
  try {
@@ -1116,7 +1112,7 @@ function getPropertyTableExtension(sourceTile) {
1116
1112
  _iterator6.f();
1117
1113
  }
1118
1114
 
1119
- var extension = sourceTile === null || sourceTile === void 0 ? void 0 : (_sourceTile$content3 = sourceTile.content) === null || _sourceTile$content3 === void 0 ? void 0 : (_sourceTile$content3$ = _sourceTile$content3.gltf) === null || _sourceTile$content3$ === void 0 ? void 0 : (_sourceTile$content3$2 = _sourceTile$content3$.extensions) === null || _sourceTile$content3$2 === void 0 ? void 0 : _sourceTile$content3$2[extensionName];
1115
+ var extension = tileContent === null || tileContent === void 0 ? void 0 : (_tileContent$gltf2 = tileContent.gltf) === null || _tileContent$gltf2 === void 0 ? void 0 : (_tileContent$gltf2$ex = _tileContent$gltf2.extensions) === null || _tileContent$gltf2$ex === void 0 ? void 0 : _tileContent$gltf2$ex[extensionName];
1120
1116
  return {
1121
1117
  extensionName: extensionName,
1122
1118
  extension: extension