aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-05-25 14:30:13 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-05-25 14:30:13 +1000
commit6f74da1aeb594b5ae979827ab692490d58f0ac84 (patch)
treeefad12ba8145e18e99fcc03e2128ce80471d37ae
parent9137bd62295df0393e0b210762b781bfcde1e446 (diff)
ignore spaces when comparing housenumber and unit
-rwxr-xr-xbin/conflate.js4
1 files changed, 2 insertions, 2 deletions
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