Skip to content

Commit 765bb92

Browse files
Fix geostats creation when column names contain unicode or special characters
1 parent 9987eb6 commit 765bb92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/spatial-uploads-handler/src/geostatsForVectorLayer.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ export async function geostatsForVectorLayers(
152152
layer.hasZ = hasZ;
153153
}
154154
for (const attribute of layer.attributes) {
155-
const value = feature.fields.get(attribute.attribute);
155+
// Use the index of the attribute, rather than the attribute name/key,
156+
// as this can cause issues when there are unicode names
157+
const value = feature.fields.get(layer.attributes.indexOf(attribute));
156158
if (value === null) {
157159
continue;
158160
}

0 commit comments

Comments
 (0)