diff options
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 |