From 5a92c566376ce7105dac609e7a1beae3e5100232 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Tue, 8 Jun 2021 16:33:11 +1000 Subject: exclude addr:suburb, addr:postcode, addr:state due to some opposition from the local community --- lib/toOSM.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'lib/toOSM.js') diff --git a/lib/toOSM.js b/lib/toOSM.js index c928cfa..df378ee 100644 --- a/lib/toOSM.js +++ b/lib/toOSM.js @@ -250,22 +250,24 @@ module.exports = (sourceFeature, options) => { ].join(' ')) } - // every record has LOCALITY populated, however some values should be empty - if (sourceProperties.LOCALITY && !emptyNames.includes(sourceProperties.LOCALITY)) { - const suburb = capitalCase(sourceProperties.LOCALITY) + if (options && options.includeDerivableProperties) { + // every record has LOCALITY populated, however some values should be empty + if (sourceProperties.LOCALITY && !emptyNames.includes(sourceProperties.LOCALITY)) { + const suburb = capitalCase(sourceProperties.LOCALITY) - // some special cases are defined in suburbMap - outputProperties['addr:suburb'] = suburb in suburbMap ? suburbMap[suburb] : suburb - } + // some special cases are defined in suburbMap + outputProperties['addr:suburb'] = suburb in suburbMap ? suburbMap[suburb] : suburb + } - // every record has STATE populated - if (sourceProperties.STATE) { - outputProperties['addr:state'] = sourceProperties.STATE - } + // every record has STATE populated + if (sourceProperties.STATE) { + outputProperties['addr:state'] = sourceProperties.STATE + } - // some records have no POSTCODE populated - if (sourceProperties.POSTCODE) { - outputProperties['addr:postcode'] = sourceProperties.POSTCODE + // some records have no POSTCODE populated + if (sourceProperties.POSTCODE) { + outputProperties['addr:postcode'] = sourceProperties.POSTCODE + } } outputFeature.properties = outputProperties -- cgit v1.2.3