pelias icon indicating copy to clipboard operation
pelias copied to clipboard

Strange inconsistent results between search, locate, and autocomplete

Open yocontra opened this issue 3 years ago • 3 comments

Describe the bug

With a specific address, the results between multiple endpoints are inconsistent.

Steps to Reproduce

The address in question is 6131 E Costa Del Rey, Long Beach, CA, 90803. We have been having a ton of issues geocoding addresses in Long Beach and LA county specifically, but this address should demonstrate the point. I can provide more (100s of failures) if needed to debug further. There are a handful of counties that have been problem areas for us with pelias (Guilford County, NC is another one) but I will open follow-up tickets for those if the solution for this county doesn't fix those as well.

The Search Endpoint

When provided with the complete address, this fails and returns the centroid for the city: https://pelias.github.io/compare/#/v1/search?text=6131+E+Costa+Del+Rey%2C+Long+Beach%2C+CA (on our instance we don't even get the right state, we get the centroid for Long Beach, WA)

When provided with the partial address (no city or state) it does return the correct result on this specific address, but usually not on others: https://pelias.github.io/compare/#/v1/search?text=6131+E+Costa+Del+Rey

The AutoComplete Endpoint

This endpoint works perfectly in all cases - both partial and full addresses. This is what confirmed to us that the data is in the database correctly and we weren't just missing an import.

Partial: https://pelias.github.io/compare/#/v1/autocomplete?text=6131+E+Costa+Del+Rey Full: https://pelias.github.io/compare/#/v1/autocomplete?text=6131+E+Costa+Del+Rey%2C+Long+Beach%2C+CA%2C+90803

The Locate Endpoint

This endpoint doesn't work for about 50-60% of the addresses in long beach. On our instance even when provided specific postal codes or states it will return results outside of those constraints with a confidence of 1. We get the centroid of Long Beach, WA on most of our calls to this endpoint.

For this specific address, it returns the centroid of Long Beach, CA: https://pelias.github.io/compare/#/v1/search/structured?address=6131+E+Costa+Del+Rey&locality=Long+Beach&region=CA&postalcode=90803&country=USA

Additional context

There doesn't seem to be anything weird about this region, except that the openaddress importer for Long Beach is missing a zip code. I've debugged the data flow fully and think the issue is a combination of the actual query.

Then I guess there is the separate issue of the confidence system giving a 100% confidence to results not even in the same state on the locate endpoint, even when the state was provided. This seems related to or a duplicate of https://github.com/pelias/pelias/issues/873.

Please let me know if I can provide any additional help or debugging to assist with fixing this. If one of the maintainers is able to identify the issue but doesn't have the time to do the implementation I would love to submit a PR for implementation as well.

yocontra avatar Jul 31 '20 18:07 yocontra