diff options
-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', |