cityofaustin / vision-zero

The technology that powers the City of Austin's Vision Zero program
https://visionzero.austin.gov/viewer/
11 stars 4 forks source link

Implement bounding box on HERE geocodes #495

Closed JaceDeloney closed 4 years ago

JaceDeloney commented 4 years ago

Based on HERE geocode results, it doesn't look like we are using a bounding box. A bounding box could greatly improve the accuracy of our geocodes, and at minimum restrict out-of-bounds addresses/coordinates. For example, using "Cesar Chavez" would restrict results to Austin's Cesar Chavez Street only.

Implement a bounding box for our HERE geocodes so that any addresses from CRIS will only return results in Austin, TX. Here are instructions for placing a bounding box over a mapview parameter: https://developer.here.com/api-explorer/rest/geocoder/latitude-longitude-by-mapview-parameter

sergiogcx commented 4 years ago

After discussing with the team, we will start with this bounding box. This can be changed at any time in the ETL configuration.

2019-12-09_15-36-11.png

sergiogcx commented 4 years ago

I think the bound box may be helpful, though the documentation isn't very clear what the results mean.

Within a mapview (bound box) over the city of Austin, I ran "8700 Cameron", and the result match type came as pointAddress:

https://geocoder.api.here.com/6.2/geocode.json?searchtext=8700%20cameron&mapview=30.4064%2C-97.8659%3B30.1811%2C-97.5583&gen=9&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ

Then I tried intentionally a street outside the boundbox "601 University Dr, " which is in San Marcos, it returns a record from Canada with 100% confidence, but the match type is interpolated.

That should be enough for us to determine if the address is in Austin and/or a good guess.

sergiogcx commented 4 years ago

I've continued to do some testing, and I identified a street that exists in Dallas but not in Austin or San Antonio:

4415 Sachse Rd

https://geocoder.api.here.com/6.2/geocode.json?searchtext=4415%20Sachse%20Rd&mapview=30.9406%2C-97.9047%3B30.1077%2C-96.9159&gen=9&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ

If I move the mapview to Dallas it will find it, but if I move it to Austin, Here will not report any matches.

Just thrown off by this kind of records, interpolated , I am thinking that I will have to filter those records out.

2019-12-10_20-44-53.png

sergiogcx commented 4 years ago

Since we have the coordinates, all I have to do is a little subtraction and I can determine if the coordinates lie within our box, I don't want to overengineer this geocoder so I am going to keep the loop simple and start working on the graphql mutation to insert coordinates into our records.