api icon indicating copy to clipboard operation
api copied to clipboard

Address search using IDs fails when county name is similar to a locality name

Open missinglink opened this issue 5 years ago • 2 comments

This specific test-case came in via email today:

3681 Jackson Run Rd, Warren, PA 16365

We fail to return the correct result for the input above but it works correctly when including 'County' in the query as below:

3681 Jackson Run Rd, Warren County, PA 16365

It seems as though placeholder is returning the correct ID 102081337 but the logic described in the comments of https://github.com/pelias/api/blob/master/query/address_search_using_ids.js seems to be preventing it from being included:

From experience, when there's ambiguity between locality and county for an input, the user is, with complete metaphysical certitude, referring to the city. If they were referring to the county, they would have entered 'York County, PA'.

@orangejulius what do you think, do you think we can fix this class of error?

missinglink avatar Jul 02 '20 11:07 missinglink

I'm not familiar with the area but there is a locality a localadmin and a county record for 'Warren'.

I'm assuming that the issue is that the county isn't matching, but it could also be that the address is too far outside the boundary we have for Warren locality and that's what's causing the issue?

missinglink avatar Jul 02 '20 11:07 missinglink

It looks like we don't have much data in the area here: the second query returns an interpolated address.

Since its interpolated, we can't return a more accurate locality via postal cities. Fortunately, we have 16365 -> Warren in the postal cities data mapping, so if we ever do get more data, things will work out.

I think the logic in place to deal with cities/counties is a bit US-specific, but broadly correct, and we probably shouldn't change anything.

orangejulius avatar Jul 02 '20 13:07 orangejulius