@itwin/map-layers-formats 4.1.0-dev.63 → 4.1.0-dev.66
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/CHANGELOG.md +16 -1
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts +3 -1
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js +4 -0
- package/lib/cjs/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts +10 -4
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js +71 -12
- package/lib/cjs/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +1 -0
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js +18 -0
- package/lib/cjs/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +9 -1
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js +144 -110
- package/lib/cjs/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js +88 -128
- package/lib/cjs/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts +152 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.js +181 -0
- package/lib/cjs/ArcGisFeature/EsriSymbology.js.map +1 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts +3 -1
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js +4 -0
- package/lib/esm/ArcGisFeature/ArcGisCanvasRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts +10 -4
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js +71 -12
- package/lib/esm/ArcGisFeature/ArcGisFeatureProvider.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts +1 -0
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js +18 -0
- package/lib/esm/ArcGisFeature/ArcGisJsonFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts +9 -1
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js +144 -110
- package/lib/esm/ArcGisFeature/ArcGisPbfFeatureReader.js.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts +32 -77
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.d.ts.map +1 -1
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js +84 -124
- package/lib/esm/ArcGisFeature/ArcGisSymbologyRenderer.js.map +1 -1
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts +152 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.d.ts.map +1 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.js +170 -0
- package/lib/esm/ArcGisFeature/EsriSymbology.js.map +1 -0
- package/package.json +11 -11
|
@@ -29,6 +29,104 @@ export class ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {
|
|
|
29
29
|
return "esriGeometryNull";
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
getNumericValue(attrValue) {
|
|
33
|
+
const propertyValue = { valueFormat: PropertyValueFormat.Primitive };
|
|
34
|
+
let typename = StandardTypeNames.Number;
|
|
35
|
+
if (attrValue.has_double_value) {
|
|
36
|
+
const value = this.toFixedWithoutPadding(attrValue.double_value);
|
|
37
|
+
propertyValue.value = value;
|
|
38
|
+
typename = StandardTypeNames.Double;
|
|
39
|
+
}
|
|
40
|
+
else if (attrValue.has_float_value) {
|
|
41
|
+
const value = this.toFixedWithoutPadding(attrValue.float_value);
|
|
42
|
+
propertyValue.value = value;
|
|
43
|
+
typename = StandardTypeNames.Float;
|
|
44
|
+
}
|
|
45
|
+
else if (attrValue.has_int64_value) {
|
|
46
|
+
propertyValue.value = attrValue.int64_value;
|
|
47
|
+
typename = StandardTypeNames.Integer;
|
|
48
|
+
}
|
|
49
|
+
else if (attrValue.has_sint64_value) {
|
|
50
|
+
propertyValue.value = attrValue.sint64_value;
|
|
51
|
+
typename = StandardTypeNames.Integer;
|
|
52
|
+
}
|
|
53
|
+
else if (attrValue.has_sint_value) {
|
|
54
|
+
propertyValue.value = attrValue.sint_value;
|
|
55
|
+
typename = StandardTypeNames.Integer;
|
|
56
|
+
}
|
|
57
|
+
else if (attrValue.has_uint64_value) {
|
|
58
|
+
propertyValue.value = attrValue.uint64_value;
|
|
59
|
+
typename = StandardTypeNames.Integer;
|
|
60
|
+
}
|
|
61
|
+
else if (attrValue.has_uint_value) {
|
|
62
|
+
propertyValue.value = attrValue.uint_value;
|
|
63
|
+
typename = StandardTypeNames.Integer;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
propertyValue.value = undefined;
|
|
67
|
+
}
|
|
68
|
+
return { propertyValue, typename };
|
|
69
|
+
}
|
|
70
|
+
getFeatureAttribute(fieldInfo, attrValue) {
|
|
71
|
+
let propertyValue = { valueFormat: PropertyValueFormat.Primitive };
|
|
72
|
+
let typename = StandardTypeNames.String;
|
|
73
|
+
if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
|
|
74
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
|
|
75
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
|
|
76
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
|
|
77
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
|
|
78
|
+
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
79
|
+
const value = this.getNumericValue(attrValue);
|
|
80
|
+
if (value.propertyValue === undefined) {
|
|
81
|
+
Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
85
|
+
const test = value.propertyValue.value;
|
|
86
|
+
propertyValue.value = new Date(test);
|
|
87
|
+
typename = StandardTypeNames.DateTime;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
typename = value.typename;
|
|
91
|
+
propertyValue = value.propertyValue;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
|
|
95
|
+
if (attrValue.has_string_value) {
|
|
96
|
+
propertyValue.value = attrValue.string_value;
|
|
97
|
+
typename = StandardTypeNames.String;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
|
|
101
|
+
if (attrValue.has_string_value) {
|
|
102
|
+
propertyValue.value = attrValue.string_value;
|
|
103
|
+
typename = StandardTypeNames.String;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
const value = this.getNumericValue(attrValue);
|
|
107
|
+
if (value.propertyValue === undefined) {
|
|
108
|
+
Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
else if (attrValue.has_string_value) {
|
|
114
|
+
// If we reach this case that probably mean we don't support the field type, simply try to output string value
|
|
115
|
+
typename = StandardTypeNames.String;
|
|
116
|
+
propertyValue.value = attrValue.string_value;
|
|
117
|
+
}
|
|
118
|
+
else if (attrValue.value_type === "none") {
|
|
119
|
+
// Sometimes fields are just empty, use an empty string
|
|
120
|
+
typename = StandardTypeNames.String;
|
|
121
|
+
propertyValue.value = undefined;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
128
|
+
return { value: propertyValue, property: { name: fieldInfo.name, displayLabel: fieldInfo.name, typename } };
|
|
129
|
+
}
|
|
32
130
|
async readAndRender(response, renderer) {
|
|
33
131
|
if (!(response.data instanceof esriPBuffer.FeatureCollectionPBuffer)) {
|
|
34
132
|
const msg = "Response was not in PBF format";
|
|
@@ -38,19 +136,53 @@ export class ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {
|
|
|
38
136
|
const collection = response.data;
|
|
39
137
|
if (!collection.has_queryResult || !collection.queryResult.has_featureResult || collection?.queryResult?.featureResult?.features === undefined)
|
|
40
138
|
return;
|
|
139
|
+
const attrSymbology = renderer.attributeSymbology;
|
|
140
|
+
// Fields metadata is stored outside feature results, create dedicated array first
|
|
141
|
+
const fields = [];
|
|
142
|
+
for (const field of collection.queryResult.featureResult.fields)
|
|
143
|
+
fields.push({ name: field.name, type: field.fieldType });
|
|
41
144
|
const geomType = collection.queryResult.featureResult.geometryType;
|
|
42
145
|
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
146
|
+
const relativeCoords = renderer.transform === undefined;
|
|
147
|
+
for (const feature of collection.queryResult.featureResult.features) {
|
|
148
|
+
// Render geometries
|
|
149
|
+
if (renderer && feature?.has_geometry) {
|
|
150
|
+
if (attrSymbology) {
|
|
151
|
+
// Read attributes if needed (attribute driven symbology)
|
|
152
|
+
this.applySymbologyAttributes(attrSymbology, feature, fields);
|
|
153
|
+
}
|
|
154
|
+
if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {
|
|
155
|
+
await renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, relativeCoords);
|
|
156
|
+
}
|
|
157
|
+
else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {
|
|
158
|
+
const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);
|
|
159
|
+
await renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, relativeCoords);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
applySymbologyAttributes(attrSymbology, feature, fields) {
|
|
165
|
+
if (attrSymbology) {
|
|
166
|
+
const symbolFields = attrSymbology.rendererFields;
|
|
167
|
+
if (symbolFields && symbolFields.length > 0 && feature.attributes) {
|
|
168
|
+
let fieldIdx = 0;
|
|
169
|
+
const featureAttr = {};
|
|
170
|
+
for (const attrValue of feature.attributes) {
|
|
171
|
+
if (fieldIdx > fields.length) {
|
|
172
|
+
Logger.logError(loggerCategory, "Error while read feature info data: fields metadata missing");
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
const fieldInfo = fields[fieldIdx++];
|
|
176
|
+
if (symbolFields.includes(fieldInfo.name)) {
|
|
177
|
+
const attr = this.getFeatureAttribute(fieldInfo, attrValue);
|
|
178
|
+
if (attr) {
|
|
179
|
+
const primitiveValue = attr.value;
|
|
180
|
+
featureAttr[fieldInfo.name] = primitiveValue.value;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
attrSymbology.setActiveFeatureAttributes(featureAttr);
|
|
185
|
+
}
|
|
54
186
|
}
|
|
55
187
|
}
|
|
56
188
|
async readFeatureInfo(response, featureInfos, renderer) {
|
|
@@ -65,104 +197,6 @@ export class ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {
|
|
|
65
197
|
const fields = [];
|
|
66
198
|
for (const field of collection.queryResult.featureResult.fields)
|
|
67
199
|
fields.push({ name: field.name, type: field.fieldType });
|
|
68
|
-
const getNumericValue = (attrValue) => {
|
|
69
|
-
const propertyValue = { valueFormat: PropertyValueFormat.Primitive };
|
|
70
|
-
let typename = StandardTypeNames.Number;
|
|
71
|
-
if (attrValue.has_double_value) {
|
|
72
|
-
const value = this.toFixedWithoutPadding(attrValue.double_value);
|
|
73
|
-
propertyValue.value = value;
|
|
74
|
-
typename = StandardTypeNames.Double;
|
|
75
|
-
}
|
|
76
|
-
else if (attrValue.has_float_value) {
|
|
77
|
-
const value = this.toFixedWithoutPadding(attrValue.float_value);
|
|
78
|
-
propertyValue.value = value;
|
|
79
|
-
typename = StandardTypeNames.Float;
|
|
80
|
-
}
|
|
81
|
-
else if (attrValue.has_int64_value) {
|
|
82
|
-
propertyValue.value = attrValue.int64_value;
|
|
83
|
-
typename = StandardTypeNames.Integer;
|
|
84
|
-
}
|
|
85
|
-
else if (attrValue.has_sint64_value) {
|
|
86
|
-
propertyValue.value = attrValue.sint64_value;
|
|
87
|
-
typename = StandardTypeNames.Integer;
|
|
88
|
-
}
|
|
89
|
-
else if (attrValue.has_sint_value) {
|
|
90
|
-
propertyValue.value = attrValue.sint_value;
|
|
91
|
-
typename = StandardTypeNames.Integer;
|
|
92
|
-
}
|
|
93
|
-
else if (attrValue.has_uint64_value) {
|
|
94
|
-
propertyValue.value = attrValue.uint64_value;
|
|
95
|
-
typename = StandardTypeNames.Integer;
|
|
96
|
-
}
|
|
97
|
-
else if (attrValue.has_uint_value) {
|
|
98
|
-
propertyValue.value = attrValue.uint_value;
|
|
99
|
-
typename = StandardTypeNames.Integer;
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
propertyValue.value = undefined;
|
|
103
|
-
}
|
|
104
|
-
return { propertyValue, typename };
|
|
105
|
-
};
|
|
106
|
-
const getFeatureAttribute = (fieldInfo, attrValue) => {
|
|
107
|
-
let propertyValue = { valueFormat: PropertyValueFormat.Primitive };
|
|
108
|
-
let typename = StandardTypeNames.String;
|
|
109
|
-
if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDouble
|
|
110
|
-
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeInteger
|
|
111
|
-
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSmallInteger
|
|
112
|
-
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeOID
|
|
113
|
-
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeSingle
|
|
114
|
-
|| fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
115
|
-
const value = getNumericValue(attrValue);
|
|
116
|
-
if (value.propertyValue === undefined) {
|
|
117
|
-
Logger.logError(loggerCategory, `Could not read numeric value for field ${fieldInfo.name}`);
|
|
118
|
-
return undefined;
|
|
119
|
-
}
|
|
120
|
-
if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeDate) {
|
|
121
|
-
const test = value.propertyValue.value;
|
|
122
|
-
propertyValue.value = new Date(test);
|
|
123
|
-
typename = StandardTypeNames.DateTime;
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
typename = value.typename;
|
|
127
|
-
propertyValue = value.propertyValue;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeString) {
|
|
131
|
-
if (attrValue.has_string_value) {
|
|
132
|
-
propertyValue.value = attrValue.string_value;
|
|
133
|
-
typename = StandardTypeNames.String;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
else if (fieldInfo.type === esriPBuffer.FeatureCollectionPBuffer.FieldType.esriFieldTypeGlobalID) {
|
|
137
|
-
if (attrValue.has_string_value) {
|
|
138
|
-
propertyValue.value = attrValue.string_value;
|
|
139
|
-
typename = StandardTypeNames.String;
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
const value = getNumericValue(attrValue);
|
|
143
|
-
if (value.propertyValue === undefined) {
|
|
144
|
-
Logger.logError(loggerCategory, `Could not read GlobalId value for field ${fieldInfo.name}`);
|
|
145
|
-
return undefined;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
else if (attrValue.has_string_value) {
|
|
150
|
-
// If we reach this case that probably mean we don't support the field type, simply try to output string value
|
|
151
|
-
typename = StandardTypeNames.String;
|
|
152
|
-
propertyValue.value = attrValue.string_value;
|
|
153
|
-
}
|
|
154
|
-
else if (attrValue.value_type === "none") {
|
|
155
|
-
// Sometimes fields are just empty, use an empty string
|
|
156
|
-
typename = StandardTypeNames.String;
|
|
157
|
-
propertyValue.value = undefined;
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
Logger.logError(loggerCategory, `Could not read value for field ${fieldInfo.name}`);
|
|
161
|
-
return undefined;
|
|
162
|
-
}
|
|
163
|
-
propertyValue.displayValue = this.getDisplayValue(typename, propertyValue.value);
|
|
164
|
-
return { value: propertyValue, property: { name: fieldInfo.name, displayLabel: fieldInfo.name, typename } };
|
|
165
|
-
};
|
|
166
200
|
const geomType = collection.queryResult.featureResult.geometryType;
|
|
167
201
|
const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;
|
|
168
202
|
const subLayerInfo = {
|
|
@@ -193,7 +227,7 @@ export class ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {
|
|
|
193
227
|
break;
|
|
194
228
|
}
|
|
195
229
|
// Convert everything to string for now
|
|
196
|
-
const attr = getFeatureAttribute(fields[fieldIdx], attrValue);
|
|
230
|
+
const attr = this.getFeatureAttribute(fields[fieldIdx], attrValue);
|
|
197
231
|
if (attr) {
|
|
198
232
|
feature.attributes?.push(attr);
|
|
199
233
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisPbfFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisPbfFeatureReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAkB,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,gBAAgB,GAAG,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC;AAC3E,MAAM,cAAc,GAAG,gCAAgC,CAAC;AAOxD,gBAAgB;AAChB,MAAM,OAAO,sBAAuB,SAAQ,uBAAuB;IACjE,YAAmB,QAA+B,EAAE,aA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AAC;YACjB,KAAK,MAAM,SAAS,IAAI,eAAe,CAAC,UAAU,EAAE;gBAClD,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE;oBAC5B,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,6DAA6D,CAAC,CAAC;oBAC/F,MAAM;iBACP;gBACD,uCAAuC;gBACvC,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;gBAC9D,IAAI,IAAI,EAAE;oBACR,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;iBAChC;gBAED,QAAQ,EAAE,CAAC;aACZ;YACD,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;QAED,IAAI,SAAS,CAAC,aAAa,KAAK,SAAS,EAAE;YACzC,SAAS,CAAC,aAAa,GAAG,EAAE,CAAC;SAC9B;QACD,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,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\nimport { esriPBuffer } from \"../ArcGisFeature/esriPBuffer.gen\";\r\nimport { ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeature, MapLayerFeatureAttribute, MapLayerFeatureInfo, MapSubLayerFeatureInfo} from \"@itwin/core-frontend\";\r\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisBaseFeatureReader } 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 ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {\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 async readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer) {\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 await 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 await renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, renderer.transform === undefined);\r\n }\r\n }\r\n\r\n public async readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer?: ArcGisGraphicsRenderer) {\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, subLayerInfos: [] };\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 getFeatureAttribute = (fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value): MapLayerFeatureAttribute|undefined => {\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 {value: propertyValue, property: { name: fieldInfo.name, displayLabel: fieldInfo.name, typename } };\r\n };\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 const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n features: [],\r\n };\r\n\r\n // Read feature values\r\n for (const featureResponse of collection.queryResult.featureResult.features) {\r\n const feature: MapLayerFeature = { attributes: []};\r\n\r\n if (renderer && featureResponse?.has_geometry) {\r\n if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {\r\n await renderer.renderPoint(featureResponse.geometry.lengths, featureResponse.geometry.coords, stride, true);\r\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\r\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\r\n await renderer.renderPath(featureResponse.geometry.lengths, featureResponse.geometry.coords, fill, stride, true);\r\n }\r\n const graphics = renderer.moveGraphics();\r\n feature.geometries = graphics.map((graphic) => {\r\n return {graphic};\r\n });\r\n }\r\n\r\n let fieldIdx = 0;\r\n for (const attrValue of featureResponse.attributes) {\r\n if (fieldIdx > 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 attr = getFeatureAttribute(fields[fieldIdx], attrValue);\r\n if (attr) {\r\n feature.attributes?.push(attr);\r\n }\r\n\r\n fieldIdx++;\r\n }\r\n subLayerInfo.features.push(feature);\r\n }\r\n\r\n if (layerInfo.subLayerInfos === undefined) {\r\n layerInfo.subLayerInfos = [];\r\n }\r\n layerInfo.subLayerInfos.push(subLayerInfo);\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ArcGisPbfFeatureReader.js","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisPbfFeatureReader.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAkB,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAG7C,MAAM,gBAAgB,GAA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AO,CAAC,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC5C,OAAO,EAAC,OAAO,EAAC,CAAC;gBACnB,CAAC,CAAC,CAAC;aACJ;YAED,IAAI,QAAQ,GAAG,CAAC,CAAC;YACjB,KAAK,MAAM,SAAS,IAAI,eAAe,CAAC,UAAU,EAAE;gBAClD,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE;oBAC5B,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,6DAA6D,CAAC,CAAC;oBAC/F,MAAM;iBACP;gBACD,uCAAuC;gBACvC,MAAM,IAAI,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,IAAI,EAAE;oBACR,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;iBAChC;gBAED,QAAQ,EAAE,CAAC;aACZ;YACD,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACrC;QAED,IAAI,SAAS,CAAC,aAAa,KAAK,SAAS,EAAE;YACzC,SAAS,CAAC,aAAa,GAAG,EAAE,CAAC;SAC9B;QACD,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,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\nimport { esriPBuffer } from \"../ArcGisFeature/esriPBuffer.gen\";\r\nimport { ArcGisAttributeDrivenSymbology, ArcGisGeometryRenderer, ArcGisGraphicsRenderer, MapLayerFeature, MapLayerFeatureAttribute, MapLayerFeatureInfo, MapSubLayerFeatureInfo} from \"@itwin/core-frontend\";\r\nimport { PrimitiveValue, PropertyValueFormat, StandardTypeNames } from \"@itwin/appui-abstract\";\r\nimport { ImageMapLayerSettings } from \"@itwin/core-common\";\r\nimport { ArcGisBaseFeatureReader } 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 ArcGisPbfFeatureReader extends ArcGisBaseFeatureReader {\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 private 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 public getFeatureAttribute(fieldInfo: PbfFieldInfo, attrValue: esriPBuffer.FeatureCollectionPBuffer.Value): MapLayerFeatureAttribute|undefined {\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 = this.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 = this.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 {value: propertyValue, property: { name: fieldInfo.name, displayLabel: fieldInfo.name, typename } };\r\n }\r\n\r\n public async readAndRender(response: ArcGisResponseData, renderer: ArcGisGeometryRenderer) {\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 attrSymbology = renderer.attributeSymbology;\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 geomType = collection.queryResult.featureResult.geometryType;\r\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\r\n const relativeCoords = renderer.transform === undefined;\r\n for (const feature of collection.queryResult.featureResult.features) {\r\n\r\n // Render geometries\r\n if (renderer && feature?.has_geometry) {\r\n\r\n if (attrSymbology) {\r\n // Read attributes if needed (attribute driven symbology)\r\n this.applySymbologyAttributes(attrSymbology, feature, fields);\r\n }\r\n\r\n if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {\r\n await renderer.renderPoint(feature.geometry.lengths, feature.geometry.coords, stride, relativeCoords);\r\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\r\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\r\n await renderer.renderPath(feature.geometry.lengths, feature.geometry.coords, fill, stride, relativeCoords);\r\n }\r\n }\r\n\r\n }\r\n }\r\n\r\n private applySymbologyAttributes(attrSymbology: ArcGisAttributeDrivenSymbology, feature: esriPBuffer.FeatureCollectionPBuffer.Feature, fields: PbfFieldInfo[]) {\r\n if (attrSymbology) {\r\n const symbolFields = attrSymbology.rendererFields;\r\n if (symbolFields && symbolFields.length > 0 && feature.attributes) {\r\n let fieldIdx = 0;\r\n const featureAttr: {[key: string]: any} = {};\r\n for (const attrValue of feature.attributes) {\r\n if (fieldIdx > fields.length) {\r\n Logger.logError(loggerCategory, \"Error while read feature info data: fields metadata missing\");\r\n break;\r\n }\r\n const fieldInfo = fields[fieldIdx++];\r\n if (symbolFields.includes(fieldInfo.name)) {\r\n const attr = this.getFeatureAttribute(fieldInfo, attrValue);\r\n if (attr) {\r\n const primitiveValue = attr.value as PrimitiveValue;\r\n featureAttr[fieldInfo.name] = primitiveValue.value;\r\n }\r\n }\r\n\r\n }\r\n attrSymbology.setActiveFeatureAttributes(featureAttr);\r\n }\r\n }\r\n }\r\n\r\n public async readFeatureInfo(response: ArcGisResponseData, featureInfos: MapLayerFeatureInfo[], renderer?: ArcGisGraphicsRenderer) {\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, subLayerInfos: [] };\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 geomType = collection.queryResult.featureResult.geometryType;\r\n const stride = (collection.queryResult.featureResult.hasM || collection.queryResult.featureResult.hasZ) ? 3 : 2;\r\n\r\n const subLayerInfo: MapSubLayerFeatureInfo = {\r\n subLayerName: this._layerMetadata.name,\r\n displayFieldName: this._layerMetadata.name,\r\n features: [],\r\n };\r\n\r\n // Read feature values\r\n for (const featureResponse of collection.queryResult.featureResult.features) {\r\n const feature: MapLayerFeature = { attributes: []};\r\n\r\n if (renderer && featureResponse?.has_geometry) {\r\n if (geomType === esriGeometryType.esriGeometryTypePoint || geomType === esriGeometryType.esriGeometryTypeMultipoint) {\r\n await renderer.renderPoint(featureResponse.geometry.lengths, featureResponse.geometry.coords, stride, true);\r\n } else if (geomType === esriGeometryType.esriGeometryTypePolyline || geomType === esriGeometryType.esriGeometryTypePolygon) {\r\n const fill = (geomType === esriGeometryType.esriGeometryTypePolygon);\r\n await renderer.renderPath(featureResponse.geometry.lengths, featureResponse.geometry.coords, fill, stride, true);\r\n }\r\n const graphics = renderer.moveGraphics();\r\n feature.geometries = graphics.map((graphic) => {\r\n return {graphic};\r\n });\r\n }\r\n\r\n let fieldIdx = 0;\r\n for (const attrValue of featureResponse.attributes) {\r\n if (fieldIdx > 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 attr = this.getFeatureAttribute(fields[fieldIdx], attrValue);\r\n if (attr) {\r\n feature.attributes?.push(attr);\r\n }\r\n\r\n fieldIdx++;\r\n }\r\n subLayerInfo.features.push(feature);\r\n }\r\n\r\n if (layerInfo.subLayerInfos === undefined) {\r\n layerInfo.subLayerInfos = [];\r\n }\r\n layerInfo.subLayerInfos.push(subLayerInfo);\r\n featureInfos.push(layerInfo);\r\n }\r\n}\r\n"]}
|
|
@@ -1,86 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EsriRenderer, EsriSymbol, EsriUniqueValueRenderer } from "./EsriSymbology";
|
|
2
|
+
import { ArcGisAttributeDrivenSymbology } from "@itwin/core-frontend";
|
|
3
3
|
/** @internal */
|
|
4
|
-
export type
|
|
5
|
-
interface EsriSymbol {
|
|
6
|
-
type: EsriSymbolType;
|
|
7
|
-
}
|
|
8
|
-
/** @internal */
|
|
9
|
-
export type EsriSLSStyle = "esriSLSDash" | "esriSLSDashDot" | "esriSLSDashDotDot" | "esriSLSDot" | "esriSLSLongDash" | "esriSLSLongDashDot" | "esriSLSNull" | "esriSLSShortDash" | "esriSLSShortDashDot" | "esriSLSShortDashDotDot" | "esriSLSShortDot" | "esriSLSSolid";
|
|
10
|
-
interface EsriSLSProps {
|
|
11
|
-
color: number[];
|
|
12
|
-
type: EsriSymbolType;
|
|
13
|
-
width: number;
|
|
14
|
-
style: EsriSLSStyle;
|
|
15
|
-
}
|
|
16
|
-
/** @internal */
|
|
17
|
-
export declare class EsriSLS implements EsriSymbol {
|
|
18
|
-
readonly props: EsriSLSProps;
|
|
19
|
-
get color(): ColorDef | undefined;
|
|
20
|
-
get type(): EsriSymbolType;
|
|
21
|
-
get width(): number;
|
|
22
|
-
get style(): EsriSLSStyle;
|
|
23
|
-
constructor(json: EsriSLSProps);
|
|
24
|
-
static fromJSON(json: EsriSLSProps): EsriSLS;
|
|
25
|
-
}
|
|
26
|
-
interface EsriPMSProps {
|
|
27
|
-
type: EsriSymbolType;
|
|
28
|
-
url: string;
|
|
29
|
-
imageData: string;
|
|
30
|
-
contentType: string;
|
|
31
|
-
width?: number;
|
|
32
|
-
height?: number;
|
|
33
|
-
xoffset?: number;
|
|
34
|
-
yoffset?: number;
|
|
35
|
-
angle?: number;
|
|
36
|
-
}
|
|
4
|
+
export type ArcGisSymbologyRendererType = "simple" | "attributeDriven";
|
|
37
5
|
/** @internal */
|
|
38
|
-
export declare class
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
get imageUrl(): string;
|
|
45
|
-
get image(): HTMLImageElement;
|
|
46
|
-
get contentType(): string;
|
|
47
|
-
get width(): number | undefined;
|
|
48
|
-
get height(): number | undefined;
|
|
49
|
-
get xoffset(): number | undefined;
|
|
50
|
-
get yoffset(): number | undefined;
|
|
51
|
-
get angle(): number | undefined;
|
|
52
|
-
constructor(json: EsriPMSProps);
|
|
53
|
-
static fromJSON(json: EsriPMSProps): EsriPMS;
|
|
6
|
+
export declare abstract class ArcGisSymbologyRenderer {
|
|
7
|
+
abstract isAttributeDriven(): this is ArcGisAttributeDrivenSymbology;
|
|
8
|
+
abstract applyFillStyle(context: CanvasRenderingContext2D): void;
|
|
9
|
+
abstract applyStrokeStyle(context: CanvasRenderingContext2D): void;
|
|
10
|
+
abstract drawPoint(context: CanvasRenderingContext2D, ptX: number, ptY: number): void;
|
|
11
|
+
static create(renderer: EsriRenderer | undefined, defaultSymbol: EsriSymbol): ArcGisSimpleSymbologyRenderer;
|
|
54
12
|
}
|
|
55
13
|
/** @internal */
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
readonly props: EsriSFSProps;
|
|
66
|
-
private _outline;
|
|
67
|
-
get color(): ColorDef | undefined;
|
|
68
|
-
get type(): EsriSymbolType;
|
|
69
|
-
get style(): EsriSFSStyleProps;
|
|
70
|
-
get outline(): EsriSLS | undefined;
|
|
71
|
-
constructor(json: EsriSFSProps);
|
|
72
|
-
static fromJSON(json: EsriSFSProps): EsriSFS;
|
|
73
|
-
}
|
|
74
|
-
/** @internal */
|
|
75
|
-
export declare class ArcGisSymbologyRenderer {
|
|
76
|
-
private _symbol;
|
|
77
|
-
private static readonly defaultPMS;
|
|
78
|
-
private static readonly defaultSLS;
|
|
79
|
-
private static readonly defaultSFS;
|
|
80
|
-
constructor(geometryType: ArcGisFeatureGeometryType, rendererDefinition: any);
|
|
14
|
+
export declare class ArcGisSimpleSymbologyRenderer extends ArcGisSymbologyRenderer {
|
|
15
|
+
isAttributeDriven(): this is ArcGisAttributeDrivenSymbology;
|
|
16
|
+
lineWidthScaleFactor: number;
|
|
17
|
+
get symbol(): EsriSymbol;
|
|
18
|
+
get defaultSymbol(): EsriSymbol;
|
|
19
|
+
protected _symbol: EsriSymbol;
|
|
20
|
+
protected _defaultSymbol: EsriSymbol;
|
|
21
|
+
readonly renderer?: EsriRenderer;
|
|
22
|
+
constructor(renderer: EsriRenderer | undefined, defaultSymbol: EsriSymbol);
|
|
81
23
|
applyFillStyle(context: CanvasRenderingContext2D): void;
|
|
24
|
+
private getFillColor;
|
|
82
25
|
applyStrokeStyle(context: CanvasRenderingContext2D): void;
|
|
83
26
|
drawPoint(context: CanvasRenderingContext2D, ptX: number, ptY: number): void;
|
|
84
27
|
}
|
|
85
|
-
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare class ArcGisUniqueValueSymbologyRenderer extends ArcGisSimpleSymbologyRenderer implements ArcGisAttributeDrivenSymbology {
|
|
30
|
+
isAttributeDriven(): this is ArcGisAttributeDrivenSymbology;
|
|
31
|
+
protected _activeFeatureAttributes: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
} | undefined;
|
|
34
|
+
protected uvRenderer: EsriUniqueValueRenderer;
|
|
35
|
+
get rendererFields(): string[] | undefined;
|
|
36
|
+
constructor(renderer: EsriUniqueValueRenderer, defaultSymbol: EsriSymbol);
|
|
37
|
+
setActiveFeatureAttributes(attributes: {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}): void;
|
|
40
|
+
}
|
|
86
41
|
//# sourceMappingURL=ArcGisSymbologyRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArcGisSymbologyRenderer.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisSymbologyRenderer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ArcGisSymbologyRenderer.d.ts","sourceRoot":"","sources":["../../../src/ArcGisFeature/ArcGisSymbologyRenderer.ts"],"names":[],"mappings":"AAOA,OAAO,EAAW,YAAY,EAAwC,UAAU,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAKtE,gBAAgB;AAChB,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG,iBAAiB,CAAC;AAEvE,gBAAgB;AAChB,8BAAsB,uBAAuB;aAC3B,iBAAiB,IAAI,IAAI,IAAI,8BAA8B;aAC3D,cAAc,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI;aACvD,gBAAgB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI;aACzD,SAAS,CAAC,OAAO,EAAE,wBAAwB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