aboutsummaryrefslogtreecommitdiff
path: root/bin/conflate.js
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-05-26 13:27:20 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-05-26 13:27:20 +1000
commit281f8b656620649a48b3ff8a2fa84c414efee452 (patch)
tree21fa1de9ab549bd3231316754fb34f4efc2c28d2 /bin/conflate.js
parente02bbf8c911081e2d31d3768decfd9b52819d48f (diff)
null or undefined check
Diffstat (limited to 'bin/conflate.js')
-rwxr-xr-xbin/conflate.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/conflate.js b/bin/conflate.js
index 1166fab..7de1fd6 100755
--- a/bin/conflate.js
+++ b/bin/conflate.js
@@ -179,7 +179,7 @@ const conflate = new Transform({
// ignoring case
// ignoring unit for the time being
// ignoring differences between "Foo - Bar Street" and "Foo-Bar Street", these kinds of names are common in country victoria
- return feature.properties['addr:street'] !== null && osmStreet !== null
+ return feature.properties['addr:street'] && osmStreet
&& feature.properties['addr:street'].toLowerCase().replaceAll(' - ', '-') === osmStreet.toLowerCase().replaceAll(' - ', '-')
&& osmHouseNumber !== null && feature.properties['addr:housenumber'].replaceAll(' ', '').toLowerCase() === osmHouseNumber.replaceAll(' ', '').toLowerCase()
&& (('addr:unit' in feature.properties && osmUnit !== null) ? feature.properties['addr:unit'].replaceAll(' ', '') === osmUnit.replaceAll(' ', '') : true)