From 281f8b656620649a48b3ff8a2fa84c414efee452 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Wed, 26 May 2021 13:27:20 +1000 Subject: null or undefined check --- bin/conflate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/conflate.js') 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) -- cgit v1.2.3