Skip to content

Commit

Permalink
Don't save duplicate quantiles
Browse files Browse the repository at this point in the history
  • Loading branch information
underbluewaters committed Jul 31, 2023
1 parent 7cf9642 commit 531d253
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/spatial-uploads-handler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,14 @@ export default async function handleUpload(
readFileSync(attrDataFname).toString()
);
if (attrData && attrData.features.length) {
attribute.quantiles = attrData.features.map(
(f: any) => f.properties.max
);
attribute.quantiles = [];
for (const feature of attrData.features) {
if (
attribute.quantiles.indexOf(feature.properties.max) === -1
) {
attribute.quantiles.push(feature.properties.max);
}
}
}
}
}
Expand Down

0 comments on commit 531d253

Please sign in to comment.