Closed mrcnc closed 7 years ago
wget -O addresses.csv https://opendata.arcgis.com/datasets/b7956c8840554a25ae4e35d08b8c17a6_0.csv
Here's a python snippet to get the list of addresses into a JS array:
import csv
csvfile = open('addresses.csv')
reader = csv.DictReader(csvfile)
addresses = [row['FULLADDR'].upper() for row in reader]
with open('addresses.js', 'w') as output:
output.write('var addresses = ')
output.write(str(addresses))
output.write(';')
Initial work started here. Still a lot of things to do...just updating here in case anyone is interested
Cool, I haven't ran the code but I have looked at it. Can I fix the thing about var _this = this;
using bind()
or call()
depending on what's easy and still readable?
@aaron-suarez...sure...if you can get this working before I get around to it, submit a PR
@mrcnc My proposal is the following. Since you haven't committed to codefornola/address-autocomplete, am I expected to do a PR to your fork? Please advise, and I'll do the PR. I just tested it with console.log and it gave me the behavior I expected. Let me know which version you'd like me to use as well. If you go with version 2, please let me know what to name this function, as I'm not entirely sure that "traverse" is even what this function is doing...
Version 1:
Object.keys(node.children).forEach(function(key) {
this.dfs(node.children[key], sofar.concat(key), words);
}.bind(this));
Version 2:
function traverse (key) {
this.dfs(node.children[key], sofar.concat(key), words);
}
Object.keys(node.children).forEach(traverse.bind(this));
Use the list here https://data.nola.gov/Geographic-Base-Layers/Addresses/s4ns-ak5d