For the address canonicalization logic to work and properly detect collisions with newly created homes (e.g. by public survey users), we need to ensure all addresses from the initial data load are canonicalized. This should already be happening automatically (we have an after_save trigger that calls the canonicalization logic), and we call home.save! (see code).
We should verify the homes table after initializing it with the latest CanonicalizeAddressJob changes to verify what values the status column has. If we see canonicalized for all of them, then that's fine. If we're still seeing unrecognized values, then we need to check why – it's possibly another Pelias issue. To get a useful answer on this, we probably need to make sure we're using the latest version of Pelias (we know the address lookups will currently fail).
We do in fact run CanonicalizeAddressJob for each thing we save, but this will be a lot so we likely want to do this one time locally and then save the output as our seed.
We want to update the seed task to skip the CanonicalizeAddress Job once we've manually geocoded the seed.
We can only make a single request at a time to Pelias's structured geocoding endpoint, so we will need to see how many requests we can send at a time, and/or stand up our own instance to increase capacity and lower amount of time to geocode, or just wait for it to happen serially.
Using the "place" endpoint we can search for multiple at a time.
Next week:
Write rake task to go through and canonicalize the existing seed data. Then we will export it as a CSV in the format we have and update it.
For the address canonicalization logic to work and properly detect collisions with newly created homes (e.g. by public survey users), we need to ensure all addresses from the initial data load are canonicalized. This should already be happening automatically (we have an
after_save
trigger that calls the canonicalization logic), and we callhome.save!
(see code).We should verify the
homes
table after initializing it with the latestCanonicalizeAddressJob
changes to verify what values thestatus
column has. If we seecanonicalized
for all of them, then that's fine. If we're still seeingunrecognized
values, then we need to check why – it's possibly another Pelias issue. To get a useful answer on this, we probably need to make sure we're using the latest version of Pelias (we know the address lookups will currently fail).