aboutsummaryrefslogtreecommitdiff
path: root/lib/filterOSM.js
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-05-04 16:12:13 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-05-04 16:12:13 +1000
commit4114f6cc1762573ddf05cf92f2d304dbf04ed04e (patch)
tree4593ff160cac3c426423d3d0b829a2adb90ca805 /lib/filterOSM.js
parent5039b0dbf3af3b93466069927d794f5b1c8ccf81 (diff)
major refactor and improvements
Diffstat (limited to 'lib/filterOSM.js')
-rw-r--r--lib/filterOSM.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/filterOSM.js b/lib/filterOSM.js
new file mode 100644
index 0000000..e530773
--- /dev/null
+++ b/lib/filterOSM.js
@@ -0,0 +1,16 @@
+module.exports = (feature, options) => {
+
+ // skip any addresses without either a housenumber or housename
+ // eg PFI 53396626 has no housenumber
+ if (
+ !('addr:housenumber' in feature.properties) &&
+ !('addr:housename' in feature.properties)
+ ) {
+ if (argv.debug) {
+ console.log(`PFI ${feature.properties._pfi} has neither a addr:housename or addr:housenumber, filtering`)
+ }
+ return false
+ }
+
+ return true
+}