From 201dfc10145a92cbce17f9774d7b662bd321b741 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Tue, 25 May 2021 21:53:57 +1000 Subject: include _osmtype and _osmid only in debug mode --- bin/conflate.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bin/conflate.js') diff --git a/bin/conflate.js b/bin/conflate.js index 7c3e222..ca54bff 100755 --- a/bin/conflate.js +++ b/bin/conflate.js @@ -15,6 +15,10 @@ const centroid = require('@turf/centroid').default const booleanIntersects = require('@turf/boolean-intersects').default const argv = require('yargs/yargs')(process.argv.slice(2)) + .option('debug', { + type: 'boolean', + description: 'Include debugging attributes on outputs' + }) .option('verbose', { type: 'boolean', description: 'Verbose logging' @@ -183,8 +187,10 @@ const conflate = new Transform({ const osmPoly = results ? (results.type === 'FeatureCollection' ? (results.features ? results.features[0] : null) : results) : null if (osmPoly) { // address found within an existing OSM address polygon - feature.properties._osmtype = osmPoly.properties['@type'] - feature.properties._osmid = osmPoly.properties['@id'] + if (argv.debug) { + feature.properties._osmtype = osmPoly.properties['@type'] + feature.properties._osmid = osmPoly.properties['@id'] + } outputStreams.withinExistingOSMAddressPoly.write(feature) -- cgit v1.2.3