1
votes

The geocoding api returns the "partial_match" flag set to true even though the the address returned matches exactly the address that was input to the api.

E.g. https://maps.googleapis.com/maps/api/geocode/json?&address=5%20de%20Mayo%2046%20San%20Bartolo%20el%20Chico%2014380%20Ciudad%20de%20M%C3%A9xico,%20CDMX%20Mexico

Output:

{"results":[{"address_components":[{"long_name":"46","short_name":"46","types":["street_number"]},{"long_name":"5 de Mayo","short_name":"5 de Mayo","types":["route"]},{"long_name":"San Bartolo el Chico","short_name":"San Bartolo el Chico","types":["political","sublocality","sublocality_level_1"]},{"long_name":"Ciudad de México","short_name":"México D.F.","types":["locality","political"]},{"long_name":"Ciudad de México","short_name":"CDMX","types":["administrative_area_level_1","political"]},{"long_name":"Mexico","short_name":"MX","types":["country","political"]},{"long_name":"14380","short_name":"14380","types":["postal_code"]}],"formatted_address":"5 de Mayo 46, San Bartolo el Chico, 14380 Ciudad de México, CDMX, Mexico","geometry":{"bounds":{"northeast":{"lat":19.2843721,"lng":-99.130791},"southwest":{"lat":19.2842738,"lng":-99.1309617}},"location":{"lat":19.284323,"lng":-99.1308764},"location_type":"ROOFTOP","viewport":{"northeast":{"lat":19.2856719302915,"lng":-99.1295273697085},"southwest":{"lat":19.2829739697085,"lng":-99.1322253302915}}},"partial_match":true,"place_id":"ChIJEV_b7g4BzoUR2gtR6kOkmZk","types":["premise"]}],"status":"OK"}

Does anyone know why is the partial_match flag being set when the address returned seems to exactly match the address entered?

1
Welcome to Stackoverflow, please give us some more information showing examples of the returned data and what you expected. A link to the documentation for the api your using would also be helpful.Keith M
@KeithM this questions seems very clear to me: exact name of the API (easy to find documentation), concise description of what is unexpected, link to the API request and copy of the JSON response at the time of writing.miguev
@miguev it's been edited since my comment, previously there was very little informationKeith M
Ah, that makes more sense, thanks!miguev

1 Answers

1
votes

Please consider filing a bug report, this does not look like the expected API behavior.

The result is a ROOFTOP results (not a RANGE_INTERPOLATED result) and it matches the query perfectly, word by word:

Query: 5 de Mayo 46 San Bartolo el Chico 14380 Ciudad de México, CDMX Mexico

Result: 5 de Mayo 46, San Bartolo el Chico, 14380 Ciudad de México, CDMX, Mexico