From 73b447f31e78978849524bacf31d2a2a1c56d293 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Wed, 9 Jun 2021 15:31:02 +1000 Subject: hide addr:unit:prefix behind a flag --- lib/toOSM.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lib/toOSM.js') diff --git a/lib/toOSM.js b/lib/toOSM.js index e96568c..86c08e5 100644 --- a/lib/toOSM.js +++ b/lib/toOSM.js @@ -59,19 +59,18 @@ module.exports = (sourceFeature, options) => { } if (bld_unit) { - // building unit type (Unit, Shop, Suite...) - // only included if a unit value is set - /* currently ommitted - if (sourceProperties.BLGUNTTYP) { - if (sourceProperties.BLGUNTTYP in buildingUnitType) { - outputProperties['addr:unit:prefix'] = capitalCase(buildingUnitType[sourceProperties.BLGUNTTYP]) - } else { - if (options && options.debug) { - console.log(`Building Unity Type ${sourceProperties.BLGUNTTYP} not recognised for ${sourceFeature}`) + if (options && options.includeUnitPrefix) { + // building unit type (Unit, Shop, Suite...) + if (sourceProperties.BLGUNTTYP) { + if (sourceProperties.BLGUNTTYP in buildingUnitType) { + outputProperties['addr:unit:prefix'] = capitalCase(buildingUnitType[sourceProperties.BLGUNTTYP]) + } else { + if (options && options.debug) { + console.log(`Building Unity Type ${sourceProperties.BLGUNTTYP} not recognised for ${sourceFeature}`) + } } } } - */ outputProperties['addr:unit'] = bld_unit } -- cgit v1.2.3