@itwin/map-layers-formats 4.0.0-dev.8 → 4.0.0-dev.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/operation/build/all.log +3 -0
- package/.rush/temp/operation/build/state.json +3 -0
- package/.rush/temp/operation/cover/all.log +98 -0
- package/.rush/temp/operation/cover/state.json +1 -1
- package/.rush/temp/operation/docs/all.log +30 -0
- package/.rush/temp/operation/docs/state.json +1 -1
- package/.rush/temp/{package-deps_build_ci.json → package-deps_build.json} +11 -11
- package/.rush/temp/package-deps_cover.json +10 -10
- package/.rush/temp/package-deps_docs.json +10 -10
- package/.rush/temp/shrinkwrap-deps.json +190 -44
- package/CHANGELOG.json +57 -0
- package/CHANGELOG.md +44 -1
- package/config/rush-project.json +1 -2
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js +132 -134
- package/lib/cjs/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js +200 -202
- package/lib/cjs/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +421 -422
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureQuery.js +82 -82
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/cjs/ArcGisFeature/ArcGisFeatureReader.js +33 -33
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/cjs/ArcGisFeature/ArcGisFeatureRenderer.js +142 -142
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js +42 -43
- package/lib/cjs/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +189 -192
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js +2267 -2270
- package/lib/cjs/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/cjs/map-layers-formats.d.ts +8 -8
- package/lib/cjs/map-layers-formats.js +28 -24
- package/lib/cjs/map-layers-formats.js.map +1 -1
- package/lib/cjs/mapLayersFormats.d.ts +10 -10
- package/lib/cjs/mapLayersFormats.js +28 -28
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +34 -34
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureJSON.test.js +161 -161
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeaturePBF.test.js +167 -167
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js +679 -680
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureQuery.test.js +103 -103
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +214 -214
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js +94 -94
- package/lib/cjs/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
- package/lib/cjs/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +59 -59
- package/lib/cjs/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/cjs/test/ArcGisFeature/Mocks.js +18 -18
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js +419 -419
- package/lib/cjs/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js +426 -426
- package/lib/cjs/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/cjs/test/coverage/.nyc_output/965fc94c-e7e4-4e85-bf72-aecce4f5ac8c.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/4935e330-732e-4dc9-9cc7-6639c02bf614.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/965fc94c-e7e4-4e85-bf72-aecce4f5ac8c.json +1 -0
- package/lib/cjs/test/coverage/.nyc_output/processinfo/index.json +1 -1
- package/lib/cjs/test/coverage/cobertura-coverage.xml +72 -72
- package/lib/cjs/test/coverage/lcov-report/index.html +5 -5
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureFormat.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureJSON.ts.html +10 -10
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeaturePBF.ts.html +7 -7
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureProvider.ts.html +10 -10
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureQuery.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureReader.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureRenderer.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisFeatureResponse.ts.html +4 -4
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/ArcGisSymbologyRenderer.ts.html +8 -8
- package/lib/cjs/test/coverage/lcov-report/src/ArcGisFeature/index.html +13 -13
- package/lib/cjs/test/coverage/lcov-report/src/index.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/map-layers-formats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov-report/src/mapLayersFormats.ts.html +1 -1
- package/lib/cjs/test/coverage/lcov.info +355 -531
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.d.ts +8 -8
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js +11 -10
- package/lib/esm/ArcGisFeature/ArcGisFeatureFormat.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.d.ts +14 -14
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js +128 -130
- package/lib/esm/ArcGisFeature/ArcGisFeatureJSON.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.d.ts +14 -14
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js +196 -198
- package/lib/esm/ArcGisFeature/ArcGisFeaturePBF.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +44 -44
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +418 -418
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts +92 -92
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureQuery.js +78 -78
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.d.ts +17 -17
- package/lib/esm/ArcGisFeature/ArcGisFeatureReader.js +29 -29
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.d.ts +32 -32
- package/lib/esm/ArcGisFeature/ArcGisFeatureRenderer.js +138 -138
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts +16 -16
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js +38 -39
- package/lib/esm/ArcGisFeature/ArcGisFeatureResponse.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +85 -85
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +183 -185
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts +1063 -1063
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js +2264 -2267
- package/lib/esm/ArcGisFeature/esriPBuffer.gen.js.map +1 -1
- package/lib/esm/map-layers-formats.d.ts +8 -8
- package/lib/esm/map-layers-formats.js +12 -12
- package/lib/esm/mapLayersFormats.d.ts +10 -10
- package/lib/esm/mapLayersFormats.js +24 -24
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureFeatureFormats.test.js +32 -32
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureJSON.test.js +159 -159
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeaturePBF.test.js +165 -165
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js +677 -678
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureProvider.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureQuery.test.js +101 -101
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureRenderer.test.js +212 -212
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js +92 -92
- package/lib/esm/test/ArcGisFeature/ArcGisFeatureResponse.test.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.d.ts +1 -1
- package/lib/esm/test/ArcGisFeature/ArcGisSymbologyRenderer.test.js +57 -57
- package/lib/esm/test/ArcGisFeature/Mocks.d.ts +6 -6
- package/lib/esm/test/ArcGisFeature/Mocks.js +15 -15
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts +55 -55
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.d.ts.map +1 -1
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js +416 -415
- package/lib/esm/test/ArcGisFeature/NewYorkDataset.js.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts +1042 -1042
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.d.ts.map +1 -1
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js +423 -422
- package/lib/esm/test/ArcGisFeature/PhillyLandmarksDataset.js.map +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/test/junit_results.xml +48 -48
- package/map-layers-formats.build.log +2 -2
- package/package.json +17 -17
- package/src/ArcGisFeature/esriPBuffer.gen.ts +1 -4
- package/src/test/ArcGisFeature/ArcGisFeatureProvider.test.ts +21 -21
- package/src/test/ArcGisFeature/NewYorkDataset.ts +187 -187
- package/src/test/ArcGisFeature/PhillyLandmarksDataset.ts +4 -4
- package/tsconfig.json +1 -2
- package/.rush/temp/operation/build_ci/state.json +0 -3
- package/lib/cjs/test/coverage/.nyc_output/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/5901bdfe-760d-4ca3-9674-876be7ed11b1.json +0 -1
- package/lib/cjs/test/coverage/.nyc_output/processinfo/bb9e12be-ea3c-4cee-99d0-c7a34bd2c47a.json +0 -1
- /package/lib/cjs/test/coverage/.nyc_output/{5901bdfe-760d-4ca3-9674-876be7ed11b1.json → 4935e330-732e-4dc9-9cc7-6639c02bf614.json} +0 -0
|
@@ -1,203 +1,201 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ArcGisFeaturePBF = void 0;
|
|
8
|
-
const esriPBuffer_gen_1 = require("../ArcGisFeature/esriPBuffer.gen");
|
|
9
|
-
const core_frontend_1 = require("@itwin/core-frontend");
|
|
10
|
-
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
11
|
-
const ArcGisFeatureReader_1 = require("./ArcGisFeatureReader");
|
|
12
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
|
-
const esriGeometryType = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType;
|
|
14
|
-
const loggerCategory = "MapLayersFormats.ArcGISFeature";
|
|
15
|
-
/** @internal */
|
|
16
|
-
class ArcGisFeaturePBF extends ArcGisFeatureReader_1.ArcGisFeatureReader {
|
|
17
|
-
constructor(settings, layerMetadata) {
|
|
18
|
-
super(settings, layerMetadata);
|
|
19
|
-
}
|
|
20
|
-
static getArcGisFeatureGeometryType(geomType) {
|
|
21
|
-
switch (geomType) {
|
|
22
|
-
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:
|
|
23
|
-
return "esriGeometryMultiPatch";
|
|
24
|
-
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:
|
|
25
|
-
return "esriGeometryMultipoint";
|
|
26
|
-
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:
|
|
27
|
-
return "esriGeometryPoint";
|
|
28
|
-
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:
|
|
29
|
-
return "esriGeometryPolygon";
|
|
30
|
-
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:
|
|
31
|
-
return "esriGeometryPolyline";
|
|
32
|
-
default:
|
|
33
|
-
return "esriGeometryNull";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
readAndRender(response, renderer) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.
|
|
117
|
-
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.
|
|
118
|
-
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
exports.ArcGisFeaturePBF = ArcGisFeaturePBF;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ArcGisFeaturePBF = void 0;
|
|
8
|
+
const esriPBuffer_gen_1 = require("../ArcGisFeature/esriPBuffer.gen");
|
|
9
|
+
const core_frontend_1 = require("@itwin/core-frontend");
|
|
10
|
+
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
11
|
+
const ArcGisFeatureReader_1 = require("./ArcGisFeatureReader");
|
|
12
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
13
|
+
const esriGeometryType = esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType;
|
|
14
|
+
const loggerCategory = "MapLayersFormats.ArcGISFeature";
|
|
15
|
+
/** @internal */
|
|
16
|
+
class ArcGisFeaturePBF extends ArcGisFeatureReader_1.ArcGisFeatureReader {
|
|
17
|
+
constructor(settings, layerMetadata) {
|
|
18
|
+
super(settings, layerMetadata);
|
|
19
|
+
}
|
|
20
|
+
static getArcGisFeatureGeometryType(geomType) {
|
|
21
|
+
switch (geomType) {
|
|
22
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipatch:
|
|
23
|
+
return "esriGeometryMultiPatch";
|
|
24
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypeMultipoint:
|
|
25
|
+
return "esriGeometryMultipoint";
|
|
26
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePoint:
|
|
27
|
+
return "esriGeometryPoint";
|
|
28
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolygon:
|
|
29
|
+
return "esriGeometryPolygon";
|
|
30
|
+
case esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.GeometryType.esriGeometryTypePolyline:
|
|
31
|
+
return "esriGeometryPolyline";
|
|
32
|
+
default:
|
|
33
|
+
return "esriGeometryNull";
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
readAndRender(response, renderer) {
|
|
37
|
+
if (!(response.data instanceof esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer)) {
|
|
38
|
+
const msg = "Response was not in PBF format";
|
|
39
|
+
core_bentley_1.Logger.logError(loggerCategory, msg);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const collection = response.data;
|
|
43
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)
|
|
44
|
+
return;
|
|
45
|
+
const geomType = collection.queryResult.featureResult.geometryType;
|
|
46
|
+
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
47
|
+
// console.log(`Nb Feature: ${collection.queryResult.featureResult.features.length}`);
|
|
48
|
+
if (geomType === esriGeometryType.esriGeometryTypePoint ||
|
|
49
|
+
geomType === esriGeometryType.esriGeometryTypeMultipoint) {
|
|
50
|
+
for (const feature of collection.queryResult.featureResult.features)
|
|
51
|
+
renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, renderer.transform === undefined);
|
|
52
|
+
}
|
|
53
|
+
else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
|
|
54
|
+
const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
|
|
55
|
+
for (const feature of collection.queryResult.featureResult.features)
|
|
56
|
+
if (feature?.has_geometry)
|
|
57
|
+
renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
readFeatureInfo(response, featureInfos) {
|
|
61
|
+
if (!(response.data instanceof esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer)) {
|
|
62
|
+
core_bentley_1.Logger.logError(loggerCategory, "Response was not in PBF format");
|
|
63
|
+
}
|
|
64
|
+
const collection = response.data;
|
|
65
|
+
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)
|
|
66
|
+
return;
|
|
67
|
+
const layerInfo = { layerName: this._settings.name, info: [] };
|
|
68
|
+
// Fields metadata is stored outside feature results, create dedicated array first
|
|
69
|
+
const fields = [];
|
|
70
|
+
for (const field of collection.queryResult.featureResult.fields)
|
|
71
|
+
fields.push({ name: field.name, type: field.fieldType });
|
|
72
|
+
const getNumericValue = (attrValue) => {
|
|
73
|
+
const propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
|
|
74
|
+
let typename = appui_abstract_1.StandardTypeNames.Number;
|
|
75
|
+
if (attrValue.has_double_value) {
|
|
76
|
+
const value = this.toFixedWithoutPadding(attrValue.double_value);
|
|
77
|
+
propertyValue.value = value;
|
|
78
|
+
typename = appui_abstract_1.StandardTypeNames.Double;
|
|
79
|
+
}
|
|
80
|
+
else if (attrValue.has_float_value) {
|
|
81
|
+
const value = this.toFixedWithoutPadding(attrValue.float_value);
|
|
82
|
+
propertyValue.value = value;
|
|
83
|
+
typename = appui_abstract_1.StandardTypeNames.Float;
|
|
84
|
+
}
|
|
85
|
+
else if (attrValue.has_int64_value) {
|
|
86
|
+
propertyValue.value = attrValue.int64_value;
|
|
87
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
88
|
+
}
|
|
89
|
+
else if (attrValue.has_sint64_value) {
|
|
90
|
+
propertyValue.value = attrValue.sint64_value;
|
|
91
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
92
|
+
}
|
|
93
|
+
else if (attrValue.has_sint_value) {
|
|
94
|
+
propertyValue.value = attrValue.sint_value;
|
|
95
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
96
|
+
}
|
|
97
|
+
else if (attrValue.has_uint64_value) {
|
|
98
|
+
propertyValue.value = attrValue.uint64_value;
|
|
99
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
100
|
+
}
|
|
101
|
+
else if (attrValue.has_uint_value) {
|
|
102
|
+
propertyValue.value = attrValue.uint_value;
|
|
103
|
+
typename = appui_abstract_1.StandardTypeNames.Integer;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
propertyValue.value = undefined;
|
|
107
|
+
}
|
|
108
|
+
return { propertyValue, typename };
|
|
109
|
+
};
|
|
110
|
+
const getRecordInfo = (fieldInfo, attrValue) => {
|
|
111
|
+
let propertyValue = { valueFormat: appui_abstract_1.PropertyValueFormat.Primitive };
|
|
112
|
+
let typename = appui_abstract_1.StandardTypeNames.String;
|
|
113
|
+
if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
|
|
114
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
|
|
115
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
|
|
116
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
|
|
117
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
|
|
118
|
+
|| fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
119
|
+
const value = getNumericValue(attrValue);
|
|
120
|
+
if (value.propertyValue === undefined) {
|
|
121
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
125
|
+
const test = value.propertyValue.value;
|
|
126
|
+
propertyValue.value = new Date(test);
|
|
127
|
+
typename = appui_abstract_1.StandardTypeNames.DateTime;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
typename = value.typename;
|
|
131
|
+
propertyValue = value.propertyValue;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
|
|
135
|
+
if (attrValue.has_string_value) {
|
|
136
|
+
propertyValue.value = attrValue.string_value;
|
|
137
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else if (fieldInfo.type === esriPBuffer_gen_1.esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
|
|
141
|
+
if (attrValue.has_string_value) {
|
|
142
|
+
propertyValue.value = attrValue.string_value;
|
|
143
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
const value = getNumericValue(attrValue);
|
|
147
|
+
if (value.propertyValue === undefined) {
|
|
148
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else if (attrValue.has_string_value) {
|
|
154
|
+
// If we reach this case that probably mean we don't support the field type, simply try to output string value
|
|
155
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
156
|
+
propertyValue.value = attrValue.string_value;
|
|
157
|
+
}
|
|
158
|
+
else if (attrValue.value_type === "none") {
|
|
159
|
+
// Sometimes fields are just empty, use an empty string
|
|
160
|
+
typename = appui_abstract_1.StandardTypeNames.String;
|
|
161
|
+
propertyValue.value = undefined;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
core_bentley_1.Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
168
|
+
return new core_frontend_1.MapFeatureInfoRecord(propertyValue, { name: fieldInfo.name, displayLabel: fieldInfo.name, typename });
|
|
169
|
+
};
|
|
170
|
+
// Read feature values
|
|
171
|
+
for (const feature of collection.queryResult.featureResult.features) {
|
|
172
|
+
const subLayerInfo = {
|
|
173
|
+
subLayerName: this._layerMetadata.name,
|
|
174
|
+
displayFieldName: this._layerMetadata.name,
|
|
175
|
+
records: [],
|
|
176
|
+
};
|
|
177
|
+
let i = 0;
|
|
178
|
+
for (const attrValue of feature.attributes) {
|
|
179
|
+
if (i > fields.length) {
|
|
180
|
+
core_bentley_1.Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
// Convert everything to string for now
|
|
184
|
+
const info = getRecordInfo(fields[i], attrValue);
|
|
185
|
+
if (info) {
|
|
186
|
+
subLayerInfo.records?.push(info);
|
|
187
|
+
}
|
|
188
|
+
i++;
|
|
189
|
+
}
|
|
190
|
+
if (layerInfo.info === undefined) {
|
|
191
|
+
layerInfo.info = [];
|
|
192
|
+
}
|
|
193
|
+
if (!(layerInfo.info instanceof HTMLElement)) {
|
|
194
|
+
layerInfo.info.push(subLayerInfo);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
featureInfos.push(layerInfo);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
exports.ArcGisFeaturePBF = ArcGisFeaturePBF;
|
|
203
201
|
//# sourceMappingURL=ArcGisFeaturePBF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisFeaturePBF.js","sourceRoot":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Content":["/*---------------------------------------------------------------------------------------------\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
|
+
{"version":3,"file":"ArcGisFeaturePBF.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisFeaturePBF.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,sEAA+D;AAC/D,wDAAyG;AACzG,0DAA+F;AAE/F,+DAA4D;AAE5D,sDAA6C;AAG7C,MAAM,gBAAgB,GAAG,6BAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC;AAC3E,MAAM,cAAc,GAAI,gCAAgC,CAAC;AAOzD,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,yCAAmB;IACvD,YAAmB,QAA+B,EAAE,aAAkB;QACpE,KAAK,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACjC,CAAC;IAEM,MAAM,CAAC,4BAA4B,CAAC,QAA2D;QACpG,QA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AM,CAAC,MAAM,EAAE;oBACrB,qBAAM,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,YAAY,CAAC,OAAO,EAAE,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;AA9LD,4CA8LC","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
|