Skip to content

Commit

Permalink
Changed to include a comma in the address (for better geocoding).
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelBone committed Sep 24, 2018
1 parent 906ff61 commit 83ae4ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions scraper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion scraper.ts
Expand Up @@ -135,14 +135,15 @@ async function main() {

// Extract the development application information.

console.log("Inserting parsed applications into the database.");
for (let rowIndex = 1; rowIndex < rows.length; rowIndex++) {
let row = rows[rowIndex];
let applicationNumber = row[applicationNumberColumnIndex].trim();
let address1 = (addressColumnIndex1 < 0) ? "" : row[addressColumnIndex1].trim();
let address2 = (addressColumnIndex2 < 0) ? "" : row[addressColumnIndex2].trim();
let description = (descriptionColumnIndex < 0) ? "" : row[descriptionColumnIndex].trim();
let receivedDate = moment(((receivedDateColumnIndex < 0) ? null : row[receivedDateColumnIndex].trim()), "D/MM/YYYY HH:mm:ss A", true); // allows the leading zero of the day to be omitted
let address = address1 + ((address1 !== "" && address2 !== "") ? " " : "") + address2;
let address = address1 + ((address1 !== "" && address2 !== "") ? ", " : "") + address2;
address = address.trim().replace(/\s\s+/g, " "); // reduce multiple consecutive spaces in the address to a single space

if (applicationNumber !== "" && address !== "")
Expand Down

0 comments on commit 83ae4ad

Please sign in to comment.