aboutsummaryrefslogtreecommitdiff
path: root/lib/toOSM.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/toOSM.js')
-rw-r--r--lib/toOSM.js66
1 files changed, 65 insertions, 1 deletions
diff --git a/lib/toOSM.js b/lib/toOSM.js
index 1e30f4d..49a3e6c 100644
--- a/lib/toOSM.js
+++ b/lib/toOSM.js
@@ -64,6 +64,67 @@ const emptyNames = [
'NOT NAMED'
]
+const suburbMap = {
+ // likely due to our capital case code
+ 'Mccrae': 'McCrae',
+ 'Mckinnon': 'McKinnon',
+ 'Mcmillans': 'McMillans',
+ 'Bend Of Islands': 'Bend of Islands',
+ 'Bridgewater On Loddon': 'Bridgewater on Loddon',
+ 'Hmas Cerberus': 'HMAS Cerberus',
+ 'Mckenzie Creek': 'McKenzie Creek',
+ 'Mcmahons Creek': 'McMahons Creek',
+ 'Murray Sunset': 'Murray-Sunset',
+ 'Yalla Y Poora': 'Yalla-y-poora',
+
+ // because these locality names are used more than once, the vicmap data has added a suffix for clarity
+ 'Bellfield Greater Melbourne': 'Bellfield',
+
+ 'Hillside Greater Melbourne': 'Hillside',
+ 'Hillside Bairnsdale': 'Hillside',
+
+ 'Springfield Romsey': 'Springfield',
+ 'Springfield Sea Lake': 'Springfield',
+
+ 'Moonlight Flat Castlemaine': 'Moonlight Flat',
+ 'Moonlight Flat Maryborough': 'Moonlight Flat',
+
+ 'Golden Point Castlemaine': 'Golden Point',
+ 'Golden Point Ballarat': 'Golden Point',
+ 'Golden Point Maryborough': 'Maryborough',
+
+ 'Ascot Ballarat': 'Ascot',
+ 'Ascot Bendigo': 'Ascot',
+
+ 'Big Hill Bendigo': 'Big Hill',
+ 'Big Hill Lorne': 'Big Hill',
+
+ 'Black Range Stawell': 'Black Range',
+
+ 'Fairy Dell Bairnsdale': 'Fairy Dell',
+ 'Fairy Dell Rochester': 'Fairy Dell',
+
+ 'Happy Valley Ballarat': 'Happy Valley',
+ 'Happy Valley Robinvale': 'Happy Valley',
+
+ 'Killara Casterton': 'Killara',
+ 'Killara Wodonga': 'Killara',
+
+ 'Merrijig Bairnsdale': 'Merrijig',
+ 'Merrijig Mount Buller': 'Merrijig',
+
+ 'Myall Kerang': 'Myall',
+ 'Myall Sea Lake': 'Myall',
+
+ 'Newtown Ballarat': 'Newtown',
+ 'Newtown Geelong': 'Newtown',
+
+ 'Stony Creek Foster': 'Stony Creek',
+ 'Stony Creek Talbot': 'Stony Creek',
+
+ 'Thomson Geelong': 'Thomson'
+}
+
/**
* Transforms a GeoJSON Feature from the Vicmap address schema into OSM schema
*
@@ -168,7 +229,10 @@ module.exports = (sourceFeature, options) => {
// every record has LOCALITY populated, however some values should be empty
if (sourceProperties.LOCALITY && !emptyNames.includes(sourceProperties.LOCALITY)) {
- outputProperties['addr:suburb'] = capitalCase(sourceProperties.LOCALITY)
+ const suburb = capitalCase(sourceProperties.LOCALITY)
+
+ // some special cases are defined in suburbMap
+ outputProperties['addr:suburb'] = suburb in suburbMap ? suburbMap[suburb] : suburb
}
// every record has STATE populated