Add statistics download button

This commit is contained in:
Pieter Vander Vennet 2024-02-09 23:05:05 +01:00
parent 16784270ce
commit cd867bf2d1
2 changed files with 27 additions and 4 deletions

View file

@ -345,11 +345,18 @@ export class GeoOperations {
return <any>way
}
public static toCSV(features: Feature[] | FeatureCollection): string {
public static toCSV(features: Feature[] | FeatureCollection, options?: {
ignoreTags?: RegExp
}): string {
const headerValuesSeen = new Set<string>()
const headerValuesOrdered: string[] = []
function addH(key) {
function addH(key: string) {
if(options?.ignoreTags){
if(key.match(options.ignoreTags)){
return
}
}
if (!headerValuesSeen.has(key)) {
headerValuesSeen.add(key)
headerValuesOrdered.push(key)