diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-26 13:17:43 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-26 13:17:43 +1000 |
commit | 65345c290668de2ffcdbfd714069af86637b6d94 (patch) | |
tree | a54ac92ee3018447b04e75adaf5c3b0955517817 /bin/conflate.js | |
parent | 823b6cd638973e00f81c82cbc4da6fa45cae3b79 (diff) |
looser matching, ignoring some whitespace and case
Diffstat (limited to 'bin/conflate.js')
-rwxr-xr-x | bin/conflate.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/conflate.js b/bin/conflate.js index e89693e..770cc57 100755 --- a/bin/conflate.js +++ b/bin/conflate.js @@ -174,8 +174,13 @@ const conflate = new Transform({ : null ) - return feature.properties['addr:street'] === osmStreet - && osmHouseNumber !== null && feature.properties['addr:housenumber'].replaceAll(' ', '') === osmHouseNumber.replaceAll(' ', '') // ignoring whitespace when comparing house numbers + // see if street matches and housenumber matches + // ignoring whitespace when comparing house numbers + // 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(' - ', '-')) + && 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) }) if (matches.length) { |