aboutsummaryrefslogtreecommitdiff
path: root/lib/toOSM.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/toOSM.js')
-rw-r--r--lib/toOSM.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/toOSM.js b/lib/toOSM.js
index 95c387f..afa8057 100644
--- a/lib/toOSM.js
+++ b/lib/toOSM.js
@@ -80,8 +80,7 @@ module.exports = (sourceFeature, options) => {
outputProperties['_pfi'] = sourceProperties.PFI
}
- // Building sub address type (eg UNIT OFFICE SHOP)
- //
+ // Building unit
// bld_unit_*
const bld_unit_1 = [
sourceProperties.BUNIT_PRE1,
@@ -110,15 +109,22 @@ module.exports = (sourceFeature, options) => {
}
if (bld_unit) {
- outputProperties['addr:unit'] = bld_unit
- }
+ // building unit type (Unit, Shop, Suite...)
+ // only included if a unit value is set
+ 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 (sourceProperties.BLGUNTTYP && sourceProperties.BLGUNTTYP in buildingUnitType) {
- outputProperties['addr:unit:type'] = buildingUnitType[sourceProperties.BLGUNTTYP]
+ outputProperties['addr:unit'] = bld_unit
}
- */
+ // house number
// house_*
const house_1 = [
sourceProperties.HSE_PREF1,
@@ -145,7 +151,8 @@ module.exports = (sourceFeature, options) => {
outputProperties['addr:housenumber'] = housenumber
}
- // display numbers used predominately in the City of Melbourne CBD by large properties. Primarily to simplify an assigned number range.
+ // display numbers used predominately in the City of Melbourne CBD by large properties.
+ // Primarily to simplify an assigned number range.
// so should map the assigned address or the signposted address?
// every record has at least ROAD_NAME populated