diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-06-08 16:33:11 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-06-08 16:33:11 +1000 |
commit | 5a92c566376ce7105dac609e7a1beae3e5100232 (patch) | |
tree | fbc863148274e0fe9075a7f9b972be3842762617 /lib/toOSM.js | |
parent | 41de7f13e6d331341443b2d846d6d44d06387d91 (diff) |
exclude addr:suburb, addr:postcode, addr:state due to some opposition from the local community
Diffstat (limited to 'lib/toOSM.js')
-rw-r--r-- | lib/toOSM.js | 28 |
1 files changed, 15 insertions, 13 deletions
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 |