diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-26 13:24:09 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-26 13:24:09 +1000 |
commit | e02bbf8c911081e2d31d3768decfd9b52819d48f (patch) | |
tree | ac28f6e714c74a7a2d5b6cebd1011860dee564e1 | |
parent | 411a9e221e30746f45b7cf89867291d8c755fe39 (diff) |
addr:street must be present to match
-rwxr-xr-x | bin/conflate.js | 3 |
1 files changed, 2 insertions, 1 deletions
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) }) |