@itwin/map-layers-formats 4.0.0-dev.23 → 4.0.0-dev.24

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 (174) hide show
  1. package/.rush/temp/operation/build_ci/state.json +1 -1
  2. package/.rush/temp/operation/cover/state.json +1 -1
  3. package/.rush/temp/operation/docs/state.json +1 -1
  4. package/.rush/temp/package-deps_build_ci.json +36 -0
  5. package/.rush/temp/package-deps_cover.json +2 -2
  6. package/.rush/temp/package-deps_docs.json +2 -2
  7. package/.rush/temp/shrinkwrap-deps.json +15 -15
  8. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  9. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
  10. package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  11. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  12. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +134 -134
  13. package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  14. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  15. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +202 -202
  16. package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  17. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  18. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +422 -422
  19. package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  20. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  21. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
  22. package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  23. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  24. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
  25. package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  26. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  27. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
  28. package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
  29. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  30. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +43 -43
  31. package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  32. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  33. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +192 -192
  34. package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  35. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  36. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2270 -2270
  37. package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  38. package/lib/cjs/map-layers-formats.d.ts +8 -8
  39. package/lib/cjs/map-layers-formats.js +24 -24
  40. package/lib/cjs/map-layers-formats.js.map +1 -1
  41. package/lib/cjs/mapLayersFormats.d.ts +10 -10
  42. package/lib/cjs/mapLayersFormats.js +28 -28
  43. package/lib/cjs/mapLayersFormats.js.map +1 -1
  44. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  45. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
  46. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -1
  47. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  48. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
  49. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
  50. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  51. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
  52. package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
  53. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  54. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +680 -680
  55. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  56. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  57. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
  58. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
  59. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  60. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
  61. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
  62. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  63. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
  64. package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  65. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  66. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
  67. package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -1
  68. package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
  69. package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
  70. package/lib/cjs/test/ArcGisFeature/Mocks.js.map +1 -1
  71. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  72. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
  73. package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  74. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  75. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
  76. package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  77. package/lib/cjs/test/coverage/.nyc_output/21dea2f4-0c38-4021-ac33-ce8107177d06.json +1 -0
  78. package/lib/cjs/test/coverage/.nyc_output/processinfo/21dea2f4-0c38-4021-ac33-ce8107177d06.json +1 -0
  79. package/lib/cjs/test/coverage/.nyc_output/processinfo/44e15f4f-b98e-48b2-9828-438a29c4e852.json +1 -0
  80. package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
  81. package/lib/cjs/test/coverage/cobertura-coverage.xml +2 -2
  82. package/lib/cjs/test/coverage/lcov-report/index.html +1 -1
  83. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
  84. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +1 -1
  85. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +1 -1
  86. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +1 -1
  87. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
  88. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
  89. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
  90. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +1 -1
  91. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +1 -1
  92. package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +1 -1
  93. package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
  94. package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
  95. package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
  96. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  97. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
  98. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +10 -10
  99. package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
  100. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
  101. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +130 -130
  102. package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
  103. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
  104. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +198 -198
  105. package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
  106. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
  107. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
  108. package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
  109. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
  110. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
  111. package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js.map +1 -1
  112. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
  113. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
  114. package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js.map +1 -1
  115. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
  116. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
  117. package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js.map +1 -1
  118. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
  119. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +39 -39
  120. package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
  121. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
  122. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +185 -185
  123. package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
  124. package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
  125. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2267 -2267
  126. package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
  127. package/lib/esm/map-layers-formats.d.ts +8 -8
  128. package/lib/esm/map-layers-formats.js +12 -12
  129. package/lib/esm/map-layers-formats.js.map +1 -1
  130. package/lib/esm/mapLayersFormats.d.ts +10 -10
  131. package/lib/esm/mapLayersFormats.js +24 -24
  132. package/lib/esm/mapLayersFormats.js.map +1 -1
  133. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
  134. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
  135. package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js.map +1 -1
  136. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
  137. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
  138. package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js.map +1 -1
  139. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
  140. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
  141. package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js.map +1 -1
  142. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
  143. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +678 -678
  144. package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
  145. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
  146. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
  147. package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js.map +1 -1
  148. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
  149. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
  150. package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js.map +1 -1
  151. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
  152. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
  153. package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
  154. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
  155. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
  156. package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js.map +1 -1
  157. package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
  158. package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
  159. package/lib/esm/test/ArcGisFeature/Mocks.js.map +1 -1
  160. package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
  161. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +415 -415
  162. package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
  163. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
  164. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +422 -422
  165. package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
  166. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  167. package/lib/test/junit_results.xml +48 -48
  168. package/map-layers-formats.build.log +2 -2
  169. package/package.json +10 -10
  170. package/.rush/temp/923a48f4cb3e3c8c6932e92b92aba71b42181b17.log +0 -10
  171. package/lib/cjs/test/coverage/.nyc_output/85d7c7a5-ec1e-4f2f-a885-3939e2898ded.json +0 -1
  172. package/lib/cjs/test/coverage/.nyc_output/processinfo/47171269-1270-4267-b496-e183c21c433d.json +0 -1
  173. package/lib/cjs/test/coverage/.nyc_output/processinfo/85d7c7a5-ec1e-4f2f-a885-3939e2898ded.json +0 -1
  174. /package/lib/cjs/test/coverage/.nyc_output/{47171269-1270-4267-b496-e183c21c433d.json → 44e15f4f-b98e-48b2-9828-438a29c4e852.json} +0 -0
@@ -1,199 +1,199 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- import { esriPBuffer } from "../ArcGisFeature/esriPBuffer.gen";
6
- import { MapFeatureInfoRecord } from "@itwin/core-frontend";
7
- import { PropertyValueFormat, StandardTypeNames } from "@itwin/appui-abstract";
8
- import { ArcGisFeatureReader } from "./ArcGisFeatureReader";
9
- import { Logger } from "@itwin/core-bentley";
10
- const esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;
11
- const loggerCategory = "MapLayersFormats.ArcGISFeature";
12
- /** @internal */
13
- export class ArcGisFeaturePBF extends ArcGisFeatureReader {
14
- constructor(settings, layerMetadata) {
15
- super(settings, layerMetadata);
16
- }
17
- static getArcGisFeatureGeometryType(geomType) {
18
- switch (geomType) {
19
- case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:
20
- return "esriGeometryMultiPatch";
21
- case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:
22
- return "esriGeometryMultipoint";
23
- case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:
24
- return "esriGeometryPoint";
25
- case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:
26
- return "esriGeometryPolygon";
27
- case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:
28
- return "esriGeometryPolyline";
29
- default:
30
- return "esriGeometryNull";
31
- }
32
- }
33
- readAndRender(response, renderer) {
34
- var _a, _b;
35
- if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {
36
- const msg = "Response was not in PBF format";
37
- Logger.logError(loggerCategory, msg);
38
- return;
39
- }
40
- const collection = response.data;
41
- if (!collection.has_queryResult || !collection.queryResult.has_featureResult || ((_b = (_a = collection === null || collection === void 0 ? void 0 : collection.queryResult) === null || _a === void 0 ? void 0 : _a.featureResult) === null || _b === void 0 ? void 0 : _b.features) === undefined)
42
- return;
43
- const geomType = collection.queryResult.featureResult.geometryType;
44
- const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
45
- // console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);
46
- if (geomType === esriGeometryType.esriGeometryTypePoint ||
47
- geomType === esriGeometryType.esriGeometryTypeMultipoint) {
48
- for (const feature of collection.queryResult.featureResult.features)
49
- renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);
50
- }
51
- else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
52
- const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
53
- for (const feature of collection.queryResult.featureResult.features)
54
- if (feature === null || feature === void 0 ? void 0 : feature.has_geometry)
55
- renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);
56
- }
57
- }
58
- readFeatureInfo(response, featureInfos) {
59
- var _a, _b, _c;
60
- if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {
61
- Logger.logError(loggerCategory, "Response was not in PBF format");
62
- }
63
- const collection = response.data;
64
- if (!collection.has_queryResult || !collection.queryResult.has_featureResult || ((_b = (_a = collection === null || collection === void 0 ? void 0 : collection.queryResult) === null || _a === void 0 ? void 0 : _a.featureResult) === null || _b === void 0 ? void 0 : _b.features) === undefined)
65
- return;
66
- const layerInfo = { layerName: this._settings.name, info: [] };
67
- // Fields metadata is stored outside feature results, create dedicated array first
68
- const fields = [];
69
- for (const field of collection.queryResult.featureResult.fields)
70
- fields.push({ name: field.name, type: field.fieldType });
71
- const getNumericValue = (attrValue) => {
72
- const propertyValue = { valueFormat: PropertyValueFormat.Primitive };
73
- let typename = StandardTypeNames.Number;
74
- if (attrValue.has_double_value) {
75
- const value = this.toFixedWithoutPadding(attrValue.double_value);
76
- propertyValue.value = value;
77
- typename = StandardTypeNames.Double;
78
- }
79
- else if (attrValue.has_float_value) {
80
- const value = this.toFixedWithoutPadding(attrValue.float_value);
81
- propertyValue.value = value;
82
- typename = StandardTypeNames.Float;
83
- }
84
- else if (attrValue.has_int64_value) {
85
- propertyValue.value = attrValue.int64_value;
86
- typename = StandardTypeNames.Integer;
87
- }
88
- else if (attrValue.has_sint64_value) {
89
- propertyValue.value = attrValue.sint64_value;
90
- typename = StandardTypeNames.Integer;
91
- }
92
- else if (attrValue.has_sint_value) {
93
- propertyValue.value = attrValue.sint_value;
94
- typename = StandardTypeNames.Integer;
95
- }
96
- else if (attrValue.has_uint64_value) {
97
- propertyValue.value = attrValue.uint64_value;
98
- typename = StandardTypeNames.Integer;
99
- }
100
- else if (attrValue.has_uint_value) {
101
- propertyValue.value = attrValue.uint_value;
102
- typename = StandardTypeNames.Integer;
103
- }
104
- else {
105
- propertyValue.value = undefined;
106
- }
107
- return { propertyValue, typename };
108
- };
109
- const getRecordInfo = (fieldInfo, attrValue) => {
110
- let propertyValue = { valueFormat: PropertyValueFormat.Primitive };
111
- let typename = StandardTypeNames.String;
112
- if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
113
- || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
114
- || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
115
- || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
116
- || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
117
- || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
118
- const value = getNumericValue(attrValue);
119
- if (value.propertyValue === undefined) {
120
- Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
121
- return undefined;
122
- }
123
- if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
124
- const test = value.propertyValue.value;
125
- propertyValue.value = new Date(test);
126
- typename = StandardTypeNames.DateTime;
127
- }
128
- else {
129
- typename = value.typename;
130
- propertyValue = value.propertyValue;
131
- }
132
- }
133
- else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
134
- if (attrValue.has_string_value) {
135
- propertyValue.value = attrValue.string_value;
136
- typename = StandardTypeNames.String;
137
- }
138
- }
139
- else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
140
- if (attrValue.has_string_value) {
141
- propertyValue.value = attrValue.string_value;
142
- typename = StandardTypeNames.String;
143
- }
144
- else {
145
- const value = getNumericValue(attrValue);
146
- if (value.propertyValue === undefined) {
147
- Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
148
- return undefined;
149
- }
150
- }
151
- }
152
- else if (attrValue.has_string_value) {
153
- // If we reach this case that probably mean we don't support the field type, simply try to output string value
154
- typename = StandardTypeNames.String;
155
- propertyValue.value = attrValue.string_value;
156
- }
157
- else if (attrValue.value_type === "none") {
158
- // Sometimes fields are just empty, use an empty string
159
- typename = StandardTypeNames.String;
160
- propertyValue.value = undefined;
161
- }
162
- else {
163
- Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
164
- return undefined;
165
- }
166
- propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
167
- return new MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });
168
- };
169
- // Read feature values
170
- for (const feature of collection.queryResult.featureResult.features) {
171
- const subLayerInfo = {
172
- subLayerName: this._layerMetadata.name,
173
- displayFieldName: this._layerMetadata.name,
174
- records: [],
175
- };
176
- let i = 0;
177
- for (const attrValue of feature.attributes) {
178
- if (i > fields.length) {
179
- Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
180
- break;
181
- }
182
- // Convert everything to string for now
183
- const info = getRecordInfo(fields[i], attrValue);
184
- if (info) {
185
- (_c = subLayerInfo.records) === null || _c === void 0 ? void 0 : _c.push(info);
186
- }
187
- i++;
188
- }
189
- if (layerInfo.info === undefined) {
190
- layerInfo.info = [];
191
- }
192
- if (!(layerInfo.info instanceof HTMLElement)) {
193
- layerInfo.info.push(subLayerInfo);
194
- }
195
- }
196
- featureInfos.push(layerInfo);
197
- }
198
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ import { esriPBuffer } from "../ArcGisFeature/esriPBuffer.gen";
6
+ import { MapFeatureInfoRecord } from "@itwin/core-frontend";
7
+ import { PropertyValueFormat, StandardTypeNames } from "@itwin/appui-abstract";
8
+ import { ArcGisFeatureReader } from "./ArcGisFeatureReader";
9
+ import { Logger } from "@itwin/core-bentley";
10
+ const esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;
11
+ const loggerCategory = "MapLayersFormats.ArcGISFeature";
12
+ /** @internal */
13
+ export class ArcGisFeaturePBF extends ArcGisFeatureReader {
14
+ constructor(settings, layerMetadata) {
15
+ super(settings, layerMetadata);
16
+ }
17
+ static getArcGisFeatureGeometryType(geomType) {
18
+ switch (geomType) {
19
+ case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:
20
+ return "esriGeometryMultiPatch";
21
+ case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:
22
+ return "esriGeometryMultipoint";
23
+ case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:
24
+ return "esriGeometryPoint";
25
+ case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:
26
+ return "esriGeometryPolygon";
27
+ case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:
28
+ return "esriGeometryPolyline";
29
+ default:
30
+ return "esriGeometryNull";
31
+ }
32
+ }
33
+ readAndRender(response, renderer) {
34
+ var _a, _b;
35
+ if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {
36
+ const msg = "Response was not in PBF format";
37
+ Logger.logError(loggerCategory, msg);
38
+ return;
39
+ }
40
+ const collection = response.data;
41
+ if (!collection.has_queryResult || !collection.queryResult.has_featureResult || ((_b = (_a = collection === null || collection === void 0 ? void 0 : collection.queryResult) === null || _a === void 0 ? void 0 : _a.featureResult) === null || _b === void 0 ? void 0 : _b.features) === undefined)
42
+ return;
43
+ const geomType = collection.queryResult.featureResult.geometryType;
44
+ const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
45
+ // console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);
46
+ if (geomType === esriGeometryType.esriGeometryTypePoint ||
47
+ geomType === esriGeometryType.esriGeometryTypeMultipoint) {
48
+ for (const feature of collection.queryResult.featureResult.features)
49
+ renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);
50
+ }
51
+ else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
52
+ const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
53
+ for (const feature of collection.queryResult.featureResult.features)
54
+ if (feature === null || feature === void 0 ? void 0 : feature.has_geometry)
55
+ renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);
56
+ }
57
+ }
58
+ readFeatureInfo(response, featureInfos) {
59
+ var _a, _b, _c;
60
+ if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {
61
+ Logger.logError(loggerCategory, "Response was not in PBF format");
62
+ }
63
+ const collection = response.data;
64
+ if (!collection.has_queryResult || !collection.queryResult.has_featureResult || ((_b = (_a = collection === null || collection === void 0 ? void 0 : collection.queryResult) === null || _a === void 0 ? void 0 : _a.featureResult) === null || _b === void 0 ? void 0 : _b.features) === undefined)
65
+ return;
66
+ const layerInfo = { layerName: this._settings.name, info: [] };
67
+ // Fields metadata is stored outside feature results, create dedicated array first
68
+ const fields = [];
69
+ for (const field of collection.queryResult.featureResult.fields)
70
+ fields.push({ name: field.name, type: field.fieldType });
71
+ const getNumericValue = (attrValue) => {
72
+ const propertyValue = { valueFormat: PropertyValueFormat.Primitive };
73
+ let typename = StandardTypeNames.Number;
74
+ if (attrValue.has_double_value) {
75
+ const value = this.toFixedWithoutPadding(attrValue.double_value);
76
+ propertyValue.value = value;
77
+ typename = StandardTypeNames.Double;
78
+ }
79
+ else if (attrValue.has_float_value) {
80
+ const value = this.toFixedWithoutPadding(attrValue.float_value);
81
+ propertyValue.value = value;
82
+ typename = StandardTypeNames.Float;
83
+ }
84
+ else if (attrValue.has_int64_value) {
85
+ propertyValue.value = attrValue.int64_value;
86
+ typename = StandardTypeNames.Integer;
87
+ }
88
+ else if (attrValue.has_sint64_value) {
89
+ propertyValue.value = attrValue.sint64_value;
90
+ typename = StandardTypeNames.Integer;
91
+ }
92
+ else if (attrValue.has_sint_value) {
93
+ propertyValue.value = attrValue.sint_value;
94
+ typename = StandardTypeNames.Integer;
95
+ }
96
+ else if (attrValue.has_uint64_value) {
97
+ propertyValue.value = attrValue.uint64_value;
98
+ typename = StandardTypeNames.Integer;
99
+ }
100
+ else if (attrValue.has_uint_value) {
101
+ propertyValue.value = attrValue.uint_value;
102
+ typename = StandardTypeNames.Integer;
103
+ }
104
+ else {
105
+ propertyValue.value = undefined;
106
+ }
107
+ return { propertyValue, typename };
108
+ };
109
+ const getRecordInfo = (fieldInfo, attrValue) => {
110
+ let propertyValue = { valueFormat: PropertyValueFormat.Primitive };
111
+ let typename = StandardTypeNames.String;
112
+ if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
113
+ || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
114
+ || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
115
+ || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
116
+ || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
117
+ || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
118
+ const value = getNumericValue(attrValue);
119
+ if (value.propertyValue === undefined) {
120
+ Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
121
+ return undefined;
122
+ }
123
+ if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
124
+ const test = value.propertyValue.value;
125
+ propertyValue.value = new Date(test);
126
+ typename = StandardTypeNames.DateTime;
127
+ }
128
+ else {
129
+ typename = value.typename;
130
+ propertyValue = value.propertyValue;
131
+ }
132
+ }
133
+ else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
134
+ if (attrValue.has_string_value) {
135
+ propertyValue.value = attrValue.string_value;
136
+ typename = StandardTypeNames.String;
137
+ }
138
+ }
139
+ else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
140
+ if (attrValue.has_string_value) {
141
+ propertyValue.value = attrValue.string_value;
142
+ typename = StandardTypeNames.String;
143
+ }
144
+ else {
145
+ const value = getNumericValue(attrValue);
146
+ if (value.propertyValue === undefined) {
147
+ Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
148
+ return undefined;
149
+ }
150
+ }
151
+ }
152
+ else if (attrValue.has_string_value) {
153
+ // If we reach this case that probably mean we don't support the field type, simply try to output string value
154
+ typename = StandardTypeNames.String;
155
+ propertyValue.value = attrValue.string_value;
156
+ }
157
+ else if (attrValue.value_type === "none") {
158
+ // Sometimes fields are just empty, use an empty string
159
+ typename = StandardTypeNames.String;
160
+ propertyValue.value = undefined;
161
+ }
162
+ else {
163
+ Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
164
+ return undefined;
165
+ }
166
+ propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
167
+ return new MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });
168
+ };
169
+ // Read feature values
170
+ for (const feature of collection.queryResult.featureResult.features) {
171
+ const subLayerInfo = {
172
+ subLayerName: this._layerMetadata.name,
173
+ displayFieldName: this._layerMetadata.name,
174
+ records: [],
175
+ };
176
+ let i = 0;
177
+ for (const attrValue of feature.attributes) {
178
+ if (i > fields.length) {
179
+ Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
180
+ break;
181
+ }
182
+ // Convert everything to string for now
183
+ const info = getRecordInfo(fields[i], attrValue);
184
+ if (info) {
185
+ (_c = subLayerInfo.records) === null || _c === void 0 ? void 0 : _c.push(info);
186
+ }
187
+ i++;
188
+ }
189
+ if (layerInfo.info === undefined) {
190
+ layerInfo.info = [];
191
+ }
192
+ if (!(layerInfo.info instanceof HTMLElement)) {
193
+ layerInfo.info.push(subLayerInfo);
194
+ }
195
+ }
196
+ featureInfos.push(layerInfo);
197
+ }
198
+ }
199
199
  //# sourceMappingURL=ArcGisFeaturePBF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArcGisFeaturePBF.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeaturePBF.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAA+C,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAkB,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,gBAAgB,GAAG,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC;AAC3E,MAAM,cAAc,GAAI,gCAAgC,CAAC;AAOzD,gBAAgB;AAChB,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IACvD,YAAmB,QAA+B,EAAE,aAAkB;QACpE,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,4BAA4B,CAAC,QAA2D;QACpG,QAAQ,QAAQ,EAAE;YAChB,KAAK,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,0BAA0B;gBAC/E,OAAO,wBAAwB,CAAC;YAClC,KAAK,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,0BAA0B;gBAC/E,OAAO,wBAAwB,CAAC;YAClC,KAAK,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,qBAAqB;gBAC1E,OAAO,mBAAmB,CAAC;YAC7B,KAAK,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,uBAAuB;gBAC5E,OAAO,qBAAqB,CAAC;YAC/B,KAAK,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,wBAAwB;g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D,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE;gBAChC,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC;aACrB;YACD,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,WAAW,CAAC,EAAE;gBAC5C,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACnC;SACF;QAED,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\nimport { esriPBuffer } from \"../ArcGisFeature/esriPBuffer.gen\";\nimport { MapFeatureInfoRecord, MapLayerFeatureInfo, MapSubLayerFeatureInfo } from \"@itwin/core-frontend\";\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\nimport { ArcGisFeatureReader } from \"./ArcGisFeatureReader\";\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport { ArcGisFeatureGeometryType } from \"./ArcGisFeatureQuery\";\n\nconst esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;\nconst loggerCategory = \"MapLayersFormats.ArcGISFeature\";\n\ninterface PbfFieldInfo {\n name: string;\n type: esriPBuffer.FeatureCollectionPBuffer.FieldType;\n}\n\n/** @internal */\nexport class ArcGisFeaturePBF extends ArcGisFeatureReader {\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\n super(settings, layerMetadata);\n }\n\n public static getArcGisFeatureGeometryType(geomType: esriPBuffer.FeatureCollectionPBuffer.GeometryType): ArcGisFeatureGeometryType {\n switch (geomType) {\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:\n return \"esriGeometryMultiPatch\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:\n return \"esriGeometryMultipoint\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:\n return \"esriGeometryPoint\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:\n return \"esriGeometryPolygon\";\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:\n return \"esriGeometryPolyline\";\n default:\n return \"esriGeometryNull\";\n }\n }\n\n public readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer) {\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\n const msg = \"Response was not in PBF format\";\n Logger.logError(loggerCategory, msg);\n return;\n }\n\n const collection = response.data;\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\n return;\n\n const geomType = collection.queryResult.featureResult.geometryType;\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\n\n // console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);\n if (geomType === esriGeometryType.esriGeometryTypePoint ||\n geomType === esriGeometryType.esriGeometryTypeMultipoint) {\n for (const feature of collection.queryResult.featureResult.features)\n renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\n for (const feature of collection.queryResult.featureResult.features)\n if (feature?.has_geometry)\n renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);\n }\n }\n\n public readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]) {\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\n\n Logger.logError(loggerCategory, \"Response was not in PBF format\");\n }\n\n const collection = response.data as esriPBuffer.FeatureCollectionPBuffer;\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\n return;\n\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, info: [] };\n\n // Fields metadata is stored outside feature results, create dedicated array first\n const fields: PbfFieldInfo[] = [];\n for (const field of collection.queryResult.featureResult.fields)\n fields.push({name: field.name, type:field.fieldType});\n\n const getNumericValue = (attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\n const propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\n let typename = StandardTypeNames.Number;\n if (attrValue.has_double_value) {\n const value = this.toFixedWithoutPadding(attrValue.double_value);\n propertyValue.value = value;\n typename = StandardTypeNames.Double;\n } else if (attrValue.has_float_value) {\n const value = this.toFixedWithoutPadding(attrValue.float_value);\n propertyValue.value = value;\n typename = StandardTypeNames.Float;\n } else if (attrValue.has_int64_value) {\n propertyValue.value = attrValue.int64_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_sint64_value) {\n propertyValue.value = attrValue.sint64_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_sint_value) {\n propertyValue.value = attrValue.sint_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_uint64_value) {\n propertyValue.value = attrValue.uint64_value;\n typename = StandardTypeNames.Integer;\n } else if (attrValue.has_uint_value) {\n propertyValue.value = attrValue.uint_value;\n typename = StandardTypeNames.Integer;\n } else {\n propertyValue.value = undefined;\n }\n\n return { propertyValue, typename };\n };\n\n const getRecordInfo = (fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\n let propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\n\n let typename = StandardTypeNames.String;\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate\n ) {\n const value = getNumericValue(attrValue);\n if (value.propertyValue === undefined) {\n Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);\n return undefined;\n }\n\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {\n const test = (value.propertyValue.value as unknown) as number;\n propertyValue.value = new Date(test);\n typename = StandardTypeNames.DateTime;\n } else {\n typename = value.typename;\n propertyValue = value.propertyValue;\n }\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {\n if (attrValue.has_string_value) {\n propertyValue.value = attrValue.string_value;\n typename = StandardTypeNames.String;\n }\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {\n if (attrValue.has_string_value) {\n propertyValue.value = attrValue.string_value;\n typename = StandardTypeNames.String;\n } else {\n const value = getNumericValue(attrValue);\n if (value.propertyValue === undefined) {\n Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);\n return undefined;\n }\n }\n } else if (attrValue.has_string_value) {\n // If we reach this case that probably mean we don't support the field type, simply try to output string value\n typename = StandardTypeNames.String;\n propertyValue.value = attrValue.string_value;\n } else if (attrValue.value_type === \"none\") {\n // Sometimes fields are just empty, use an empty string\n typename = StandardTypeNames.String;\n propertyValue.value = undefined;\n } else {\n Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);\n return undefined;\n }\n\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\n\n return new MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });\n };\n\n // Read feature values\n for (const feature of collection.queryResult.featureResult.features) {\n const subLayerInfo: MapSubLayerFeatureInfo = {\n subLayerName: this._layerMetadata.name,\n displayFieldName: this._layerMetadata.name,\n records: [],\n };\n let i = 0;\n\n for (const attrValue of feature.attributes) {\n if (i > fields.length) {\n Logger.logError(loggerCategory, \"Error while read feature info data: fields metadata missing\");\n break;\n }\n // Convert everything to string for now\n const info = getRecordInfo(fields[i], attrValue);\n if (info) {\n subLayerInfo.records?.push(info);\n }\n\n i++;\n }\n if (layerInfo.info === undefined) {\n layerInfo.info = [];\n }\n if (!(layerInfo.info instanceof HTMLElement)) {\n layerInfo.info.push(subLayerInfo);\n }\n }\n\n featureInfos.push(layerInfo);\n }\n}\n"]}
1
+ {"version":3,"file":"ArcGisFeaturePBF.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeaturePBF.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAG/F,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAA+C,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAkB,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,gBAAgB,GAAG,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC;AAC3E,MAAM,cAAc,GAAI,gCAAgC,CAAC;AAOzD,gBAAgB;AAChB,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IACvD,YAAmB,QAA+B,EAAE,aAAkB;QACpE,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,4BAA4B,CAAC,QAA2D;QACpG,QAAQ,QAAQ,EAA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,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE;gBAC1C,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;oBACrB,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,6DAA6D,CAAC,CAAC;oBAC/F,MAAM;iBACP;gBACD,uCAAuC;gBACvC,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;gBACjD,IAAI,IAAI,EAAE;oBACR,MAAA,YAAY,CAAC,OAAO,0CAAE,IAAI,CAAC,IAAI,CAAC,CAAC;iBAClC;gBAED,CAAC,EAAE,CAAC;aACL;YACD,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE;gBAChC,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC;aACrB;YACD,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,YAAY,WAAW,CAAC,EAAE;gBAC5C,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACnC;SACF;QAED,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ArcGisFeatureRenderer } from \"./ArcGisFeatureRenderer\";\r\nimport { esriPBuffer } from \"../ArcGisFeature/esriPBuffer.gen\";\r\nimport { MapFeatureInfoRecord, MapLayerFeatureInfo, MapSubLayerFeatureInfo } from \"@itwin/core-frontend\";\r\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisFeatureReader } from \"./ArcGisFeatureReader\";\r\nimport { ArcGisResponseData } from \"./ArcGisFeatureResponse\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { ArcGisFeatureGeometryType } from \"./ArcGisFeatureQuery\";\r\n\r\nconst esriGeometryType = esriPBuffer.FeatureCollectionPBuffer.GeometryType;\r\nconst loggerCategory = \"MapLayersFormats.ArcGISFeature\";\r\n\r\ninterface PbfFieldInfo {\r\n name: string;\r\n type: esriPBuffer.FeatureCollectionPBuffer.FieldType;\r\n}\r\n\r\n/** @internal */\r\nexport class ArcGisFeaturePBF extends ArcGisFeatureReader {\r\n public constructor(settings: ImageMapLayerSettings, layerMetadata: any) {\r\n super(settings, layerMetadata);\r\n }\r\n\r\n public static getArcGisFeatureGeometryType(geomType: esriPBuffer.FeatureCollectionPBuffer.GeometryType): ArcGisFeatureGeometryType {\r\n switch (geomType) {\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:\r\n return \"esriGeometryMultiPatch\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:\r\n return \"esriGeometryMultipoint\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:\r\n return \"esriGeometryPoint\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:\r\n return \"esriGeometryPolygon\";\r\n case esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:\r\n return \"esriGeometryPolyline\";\r\n default:\r\n return \"esriGeometryNull\";\r\n }\r\n }\r\n\r\n public readAndRender(response: ArcGisResponseData, renderer: ArcGisFeatureRenderer) {\r\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\r\n const msg = \"Response was not in PBF format\";\r\n Logger.logError(loggerCategory, msg);\r\n return;\r\n }\r\n\r\n const collection = response.data;\r\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\r\n return;\r\n\r\n const geomType = collection.queryResult.featureResult.geometryType;\r\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\r\n\r\n // console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);\r\n if (geomType === esriGeometryType.esriGeometryTypePoint ||\r\n geomType === esriGeometryType.esriGeometryTypeMultipoint) {\r\n for (const feature of collection.queryResult.featureResult.features)\r\n renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);\r\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\r\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\r\n for (const feature of collection.queryResult.featureResult.features)\r\n if (feature?.has_geometry)\r\n renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);\r\n }\r\n }\r\n\r\n public readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[]) {\r\n if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {\r\n\r\n Logger.logError(loggerCategory, \"Response was not in PBF format\");\r\n }\r\n\r\n const collection = response.data as esriPBuffer.FeatureCollectionPBuffer;\r\n if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)\r\n return;\r\n\r\n const layerInfo: MapLayerFeatureInfo = { layerName: this._settings.name, info: [] };\r\n\r\n // Fields metadata is stored outside feature results, create dedicated array first\r\n const fields: PbfFieldInfo[] = [];\r\n for (const field of collection.queryResult.featureResult.fields)\r\n fields.push({name: field.name, type:field.fieldType});\r\n\r\n const getNumericValue = (attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\r\n const propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\r\n let typename = StandardTypeNames.Number;\r\n if (attrValue.has_double_value) {\r\n const value = this.toFixedWithoutPadding(attrValue.double_value);\r\n propertyValue.value = value;\r\n typename = StandardTypeNames.Double;\r\n } else if (attrValue.has_float_value) {\r\n const value = this.toFixedWithoutPadding(attrValue.float_value);\r\n propertyValue.value = value;\r\n typename = StandardTypeNames.Float;\r\n } else if (attrValue.has_int64_value) {\r\n propertyValue.value = attrValue.int64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_sint64_value) {\r\n propertyValue.value = attrValue.sint64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_sint_value) {\r\n propertyValue.value = attrValue.sint_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_uint64_value) {\r\n propertyValue.value = attrValue.uint64_value;\r\n typename = StandardTypeNames.Integer;\r\n } else if (attrValue.has_uint_value) {\r\n propertyValue.value = attrValue.uint_value;\r\n typename = StandardTypeNames.Integer;\r\n } else {\r\n propertyValue.value = undefined;\r\n }\r\n\r\n return { propertyValue, typename };\r\n };\r\n\r\n const getRecordInfo = (fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value) => {\r\n let propertyValue: PrimitiveValue = { valueFormat: PropertyValueFormat.Primitive };\r\n\r\n let typename = StandardTypeNames.String;\r\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle\r\n || fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate\r\n ) {\r\n const value = getNumericValue(attrValue);\r\n if (value.propertyValue === undefined) {\r\n Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n\r\n if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {\r\n const test = (value.propertyValue.value as unknown) as number;\r\n propertyValue.value = new Date(test);\r\n typename = StandardTypeNames.DateTime;\r\n } else {\r\n typename = value.typename;\r\n propertyValue = value.propertyValue;\r\n }\r\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {\r\n if (attrValue.has_string_value) {\r\n propertyValue.value = attrValue.string_value;\r\n typename = StandardTypeNames.String;\r\n }\r\n } else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {\r\n if (attrValue.has_string_value) {\r\n propertyValue.value = attrValue.string_value;\r\n typename = StandardTypeNames.String;\r\n } else {\r\n const value = getNumericValue(attrValue);\r\n if (value.propertyValue === undefined) {\r\n Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n }\r\n } else if (attrValue.has_string_value) {\r\n // If we reach this case that probably mean we don't support the field type, simply try to output string value\r\n typename = StandardTypeNames.String;\r\n propertyValue.value = attrValue.string_value;\r\n } else if (attrValue.value_type === \"none\") {\r\n // Sometimes fields are just empty, use an empty string\r\n typename = StandardTypeNames.String;\r\n propertyValue.value = undefined;\r\n } else {\r\n Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);\r\n return undefined;\r\n }\r\n\r\n propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);\r\n\r\n return new MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });\r\n };\r\n\r\n // Read feature values\r\n for (const feature of collection.queryResult.featureResult.features) {\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n records: [],\r\n };\r\n let i = 0;\r\n\r\n for (const attrValue of feature.attributes) {\r\n if (i > fields.length) {\r\n Logger.logError(loggerCategory, \"Error while read feature info data: fields metadata missing\");\r\n break;\r\n }\r\n // Convert everything to string for now\r\n const info = getRecordInfo(fields[i], attrValue);\r\n if (info) {\r\n subLayerInfo.records?.push(info);\r\n }\r\n\r\n i++;\r\n }\r\n if (layerInfo.info === undefined) {\r\n layerInfo.info = [];\r\n }\r\n if (!(layerInfo.info instanceof HTMLElement)) {\r\n layerInfo.info.push(subLayerInfo);\r\n }\r\n }\r\n\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
@@ -1,45 +1,45 @@
1
- import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
2
- import { Transform } from "@itwin/core-geometry";
3
- import { ArcGISImageryProvider, ImageryMapTileTree, MapLayerFeatureInfo, QuadId } from "@itwin/core-frontend";
4
- import { ArcGisExtent, ArcGisFeatureFormat, ArcGisGeometry } from "./ArcGisFeatureQuery";
5
- /**
6
- * @internal
7
- */
8
- interface ArcGisFeatureUrl {
9
- url: string;
10
- envelope?: ArcGisExtent;
11
- }
12
- /** Provide tiles from a ESRI ArcGIS Feature service
13
- * @internal
14
- */
15
- export declare class ArcGisFeatureProvider extends ArcGISImageryProvider {
16
- private _drawDebugInfo;
17
- private _debugFeatureGeom;
18
- private _supportsCoordinatesQuantization;
19
- private _querySupported;
20
- private _layerId;
21
- private _layerMetadata;
22
- private _format;
23
- serviceJson: any;
24
- private _symbologyRenderer;
25
- private static readonly _nbSubTiles;
26
- private _outSR;
27
- private _maxDepthFromLod;
28
- private _minDepthFromLod;
29
- get minimumZoomLevel(): number;
30
- get maximumZoomLevel(): number;
31
- constructor(settings: ImageMapLayerSettings);
32
- initialize(): Promise<void>;
33
- protected getLayerMetadata(layerId: number): Promise<any>;
34
- get tileSize(): number;
35
- get format(): ArcGisFeatureFormat | undefined;
36
- constructUrl(_row: number, _column: number, _zoomLevel: number): Promise<string>;
37
- constructFeatureUrl(row: number, column: number, zoomLevel: number, format: ArcGisFeatureFormat, geomOverride?: ArcGisGeometry, outFields?: string, tolerance?: number, returnGeometry?: boolean): ArcGisFeatureUrl | undefined;
38
- getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree): Promise<void>;
39
- private fetchTile;
40
- drawTileDebugInfo(row: number, column: number, zoomLevel: number, context: CanvasRenderingContext2D): void;
41
- protected computeTileWorld2CanvasTransform(row: number, column: number, zoomLevel: number): Transform | undefined;
42
- loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined>;
43
- }
44
- export {};
1
+ import { Cartographic, ImageMapLayerSettings, ImageSource } from "@itwin/core-common";
2
+ import { Transform } from "@itwin/core-geometry";
3
+ import { ArcGISImageryProvider, ImageryMapTileTree, MapLayerFeatureInfo, QuadId } from "@itwin/core-frontend";
4
+ import { ArcGisExtent, ArcGisFeatureFormat, ArcGisGeometry } from "./ArcGisFeatureQuery";
5
+ /**
6
+ * @internal
7
+ */
8
+ interface ArcGisFeatureUrl {
9
+ url: string;
10
+ envelope?: ArcGisExtent;
11
+ }
12
+ /** Provide tiles from a ESRI ArcGIS Feature service
13
+ * @internal
14
+ */
15
+ export declare class ArcGisFeatureProvider extends ArcGISImageryProvider {
16
+ private _drawDebugInfo;
17
+ private _debugFeatureGeom;
18
+ private _supportsCoordinatesQuantization;
19
+ private _querySupported;
20
+ private _layerId;
21
+ private _layerMetadata;
22
+ private _format;
23
+ serviceJson: any;
24
+ private _symbologyRenderer;
25
+ private static readonly _nbSubTiles;
26
+ private _outSR;
27
+ private _maxDepthFromLod;
28
+ private _minDepthFromLod;
29
+ get minimumZoomLevel(): number;
30
+ get maximumZoomLevel(): number;
31
+ constructor(settings: ImageMapLayerSettings);
32
+ initialize(): Promise<void>;
33
+ protected getLayerMetadata(layerId: number): Promise<any>;
34
+ get tileSize(): number;
35
+ get format(): ArcGisFeatureFormat | undefined;
36
+ constructUrl(_row: number, _column: number, _zoomLevel: number): Promise<string>;
37
+ constructFeatureUrl(row: number, column: number, zoomLevel: number, format: ArcGisFeatureFormat, geomOverride?: ArcGisGeometry, outFields?: string, tolerance?: number, returnGeometry?: boolean): ArcGisFeatureUrl | undefined;
38
+ getFeatureInfo(featureInfos: MapLayerFeatureInfo[], quadId: QuadId, carto: Cartographic, _tree: ImageryMapTileTree): Promise<void>;
39
+ private fetchTile;
40
+ drawTileDebugInfo(row: number, column: number, zoomLevel: number, context: CanvasRenderingContext2D): void;
41
+ protected computeTileWorld2CanvasTransform(row: number, column: number, zoomLevel: number): Transform | undefined;
42
+ loadTile(row: number, column: number, zoomLevel: number): Promise<ImageSource | undefined>;
43
+ }
44
+ export {};
45
45
  //# sourceMappingURL=ArcGisFeatureProvider.d.ts.map