From 6f74da1aeb594b5ae979827ab692490d58f0ac84 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Tue, 25 May 2021 14:30:13 +1000 Subject: ignore spaces when comparing housenumber and unit --- bin/conflate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/conflate.js b/bin/conflate.js index 286d249..99b7080 100755 --- a/bin/conflate.js +++ b/bin/conflate.js @@ -167,8 +167,8 @@ const conflate = new Transform({ ) return feature.properties['addr:street'] === osmStreet - && osmHouseNumber !== null && feature.properties['addr:housenumber'] === osmHouseNumber - && (('addr:unit' in feature.properties && osmUnit !== null) ? feature.properties['addr:unit'] === osmUnit : true) + && osmHouseNumber !== null && feature.properties['addr:housenumber'].replaceAll(' ', '') === osmHouseNumber.replaceAll(' ', '') // ignoring whitespace when comparing house numbers + && (('addr:unit' in feature.properties && osmUnit !== null) ? feature.properties['addr:unit'].replaceAll(' ', '') === osmUnit.replaceAll(' ', '') : true) }) if (matches.length) { // matching unit, number, street, high confidence -- cgit v1.2.3