From 765bb92807c056335902b9fe3fc4350074c73731 Mon Sep 17 00:00:00 2001 From: Chad Burt Date: Tue, 12 Nov 2024 13:39:20 -0800 Subject: [PATCH] Fix geostats creation when column names contain unicode or special characters --- .../spatial-uploads-handler/src/geostatsForVectorLayer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/spatial-uploads-handler/src/geostatsForVectorLayer.ts b/packages/spatial-uploads-handler/src/geostatsForVectorLayer.ts index b7bfbe5c..9f76375d 100644 --- a/packages/spatial-uploads-handler/src/geostatsForVectorLayer.ts +++ b/packages/spatial-uploads-handler/src/geostatsForVectorLayer.ts @@ -152,7 +152,9 @@ export async function geostatsForVectorLayers( layer.hasZ = hasZ; } for (const attribute of layer.attributes) { - const value = feature.fields.get(attribute.attribute); + // Use the index of the attribute, rather than the attribute name/key, + // as this can cause issues when there are unicode names + const value = feature.fields.get(layer.attributes.indexOf(attribute)); if (value === null) { continue; }