diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2022-05-26 11:06:05 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2022-05-26 11:06:05 +1000 |
commit | 85686cd0c711addb7892171a5b5f509bac535b33 (patch) | |
tree | 46e56a0988421fd4276cc595d2f4e05f78d9d367 | |
parent | de2604634f09d02c7e007407d53a613bbddfbaf6 (diff) |
account for addresses outside any suburb in candidates
-rwxr-xr-x | bin/candidates.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/candidates.js b/bin/candidates.js index af87f5a..31a01d6 100755 --- a/bin/candidates.js +++ b/bin/candidates.js @@ -124,7 +124,7 @@ const candidatesNewAddressesInBlocksWithoutAnyExisting = new Transform({ const suburb = findSuburb(feature) - outputFeatures['newAddressesInBlocksWithoutAnyExisting'][suburb.id].push(feature) + outputFeatures['newAddressesInBlocksWithoutAnyExisting'][suburb ? suburb.id : 0].push(feature) callback() } @@ -164,6 +164,12 @@ pipeline( console.log(err) process.exit(1) } else { + for (const layer of Object.keys(outputFeatures)) { + // plus one for features not within any suburb + outputFeatures[layer][0] = [] + } + suburbName[0] = 'OUTSIDE VIC SUBURB' + console.log('Step 2/4: Creating index of Suburbs') lookupSuburbs = new PolygonLookup({ type: 'FeatureCollection', |