Add erase all option, formatting

This commit is contained in:
Pieter Vander Vennet 2021-06-22 12:13:44 +02:00
parent 8b2aff0244
commit 62244c02c4
5 changed files with 50 additions and 36 deletions

View file

@ -94,9 +94,14 @@ export default class SimpleMetaTagger {
}
const value = feature.properties[key]
const [, denomination] = unit.findDenomination(value)
const canonical = denomination.canonicalValue(value)
let canonical = denomination.canonicalValue(value) ?? undefined;
console.log("Rewritten ", key, " from", value, "into", canonical)
if(canonical === undefined && !unit.eraseInvalid) {
break;
}
feature.properties[key] = canonical;
break;
}
}