From e02bbf8c911081e2d31d3768decfd9b52819d48f Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Wed, 26 May 2021 13:24:09 +1000 Subject: addr:street must be present to match --- bin/conflate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin/conflate.js') diff --git a/bin/conflate.js b/bin/conflate.js index f2f4b7b..1166fab 100755 --- a/bin/conflate.js +++ b/bin/conflate.js @@ -179,7 +179,8 @@ 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'].toLowerCase().replaceAll(' - ', '-') === osmStreet.toLowerCase().replaceAll(' - ', '-')) + return feature.properties['addr:street'] !== null && osmStreet !== null + && 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