Current getGeocode code distinguishes exact addresses from approximate matches by looking at the boolean at result["results"][0]["partial_match"]. Due to apparently undocumented changes to the JSON returned by the Google geocoding API, this flag is no longer reliable and now appears to include cases where a POI (e.g., "USPS Lakeview OR") returns an exact address. The result is that when exact addresses are returned, they are considered errors and not returned to the user.
There are a couple of possible new candidates for distinguishing exact addresses from more approximate ones:
If result["results"][0]["geometry"]["location_type"] equals APPROXIMATE (rather than ROOFTOP).
If result["results"][0]["types"] contains locality or political
Based on a small bit of testing, the first option appears to be more reliable. It's unclear what the types array returns under a variety of cases.
Current
getGeocode
code distinguishes exact addresses from approximate matches by looking at the boolean atresult["results"][0]["partial_match"]
. Due to apparently undocumented changes to the JSON returned by the Google geocoding API, this flag is no longer reliable and now appears to include cases where a POI (e.g., "USPS Lakeview OR") returns an exact address. The result is that when exact addresses are returned, they are considered errors and not returned to the user.There are a couple of possible new candidates for distinguishing exact addresses from more approximate ones:
result["results"][0]["geometry"]["location_type"]
equalsAPPROXIMATE
(rather thanROOFTOP
).result["results"][0]["types"]
containslocality
orpolitical
Based on a small bit of testing, the first option appears to be more reliable. It's unclear what the
types
array returns under a variety of cases.Example 1 - Exact address in, exact address out.txt Example 2 - POI ("USPS lakeview or") in, exact address out.txt Example 3 - POI ("post office lakeview or") in, approximate location out.txt