From 1966c2556487318ce700c336e73d8cd2876d50cf Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Tue, 18 May 2021 00:45:05 +1000 Subject: add --verbose logging flag --- bin/reduceOverlap.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'bin/reduceOverlap.js') diff --git a/bin/reduceOverlap.js b/bin/reduceOverlap.js index 62ba10d..2255368 100755 --- a/bin/reduceOverlap.js +++ b/bin/reduceOverlap.js @@ -12,6 +12,10 @@ const argv = require('yargs/yargs')(process.argv.slice(2)) type: 'boolean', description: 'Dumps full debug logs' }) + .option('verbose', { + type: 'boolean', + description: '' + }) .argv if (argv._.length < 2) { @@ -131,8 +135,8 @@ const reduce = new Transform({ } this.push(featureGroup.filter(f => 'addr:unit' in f.properties)[0]) } else { - nonUnitFeature.properties['addr:flats'] = unitsToRanges(allOtherUnits, featureGroup) - // TODO should we set addr:flats:prefix from addr:unit:prefix? + const flats = unitsToRanges(allOtherUnits, argv.verbose && featureGroup) + nonUnitFeature.properties['addr:flats'] = flats this.push(nonUnitFeature) } } @@ -149,7 +153,8 @@ const reduce = new Transform({ const feature = cloneDeep(featureGroup[0]) delete feature.properties['addr:unit'] - feature.properties['addr:flats'] = unitsToRanges(units, featureGroup) + const flats = unitsToRanges(units, argv.verbose && featureGroup) + feature.properties['addr:flats'] = flats this.push(feature) } } else if (featureGroup.length === 1) { -- cgit v1.2.3