aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/reduceOverlap.js11
-rwxr-xr-xbin/reduceRangeDuplicates.js2
2 files changed, 9 insertions, 4 deletions
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) {
diff --git a/bin/reduceRangeDuplicates.js b/bin/reduceRangeDuplicates.js
index 11600b4..093d9bc 100755
--- a/bin/reduceRangeDuplicates.js
+++ b/bin/reduceRangeDuplicates.js
@@ -251,7 +251,7 @@ const reduceNonRange = new Transform({
}
}
} else {
- // no addr:unit on the feature to safe to drop
+ // no addr:unit or addr:flats on the feature to safe to drop
dropFeature = true
}
break