Geocoding API will always try to give you some sort of result. When Geocoding API is unable to find an exact match for an address, it will try to match on only the street name, or even just the city/state. Google will also try to autocorrect spelling or formatting to find a match. In these instances, where Google is only matching part of the address, it is possible to have an "OK" response status but the result(s) may not be a good match for the input. The important fields to look at when evaluating the quality of a Geocoding API result are partial_match and location_type.
The partial_match flag is an immediate signal that Google did not match the full input. When the flag is set to true, you know Google either had to apply some auto-correction to find a match, or is only matching part of the address (e.g. just street name or city/state, etc.). Google could just be correcting a typo or something minor like that, so it's not necessarily a bad match, but it should be a signal to you to look for incorrect values in the result, or possibly to flag the result for manual review.
location_type is a measure of the precision of a result. If Google was able to find an exact match for the address, the location type will be ROOFTOP--the highest-quality result. If Google couldn't find an exact match, but is estimating where the address would be based on the numerical range along the street, the location type will be RANGE_INTERPOLATED. But if Google doesn't match the address (just matches the street name or city/state), the type will be GEOMETRIC_CENTER or APPROXIMATE.
In addition to the location_type, extant vs interpolated geocodes can be recognized by the format of the place_id.
- extant place_id's begin with character C and are shorter in length (27 characters).
- example: ChIJ9-QlF5IQqYkRnuUY5PwLJXA
- example: ChIJ9-QlF5IQqYkRnuUY5PwLJXA
- interpolated place_id's begin with characters other than C (for example E) and are much longer.
- example: Eig1NTcgTWlkbGFuZCBBdmUsIFNjYXJib3JvdWdoLCBPTiwgQ2FuYWRhIhsSGQoUChIJofHDcEnO1IkRPweDDusNiHcQrQQ
More on the meanings of the response fields here.
References
How can I ensure a good-quality match for an address in Geocoding API?
Comments
0 comments
Article is closed for comments.