My company gets the addresses the loading hubs for our freights every week. We need to geocode them into coordinates. But often the addresses either are incomplete or contain minor grammar mistakes, so it's impossible to input them for geocoding.
My question : when dealing with a list of wrong or incomplete addresses when geocoding, is there any general solution to solve the issue ?
If there are useful articles or resources about this topic, please let me know.
Thank you.
Geocoding / Autocomplete
According to the Geocoding Addresses Best Practices documentation:
The Place Autocomplete service returns place predictions according to your inputs. This would solve your problem of having wrongly spelled addresses.
How to get the coordinates after using Place Autocomplete?
example request for Place Autocomplete would look like this:
The Place Autocomplete is able to return the address
descriptiontogether with itsplace_id. In this sample request, you are able to get"description": "Paris, France"with a"place_id": "ChIJD7fiBh9u5kcRYJSMaMOCCwQ".Then you can use the Place ID of the predicted location to obtain the coordinates of that place by using Place Details request
You can request it like this:
We used here the
fields=geometryto only return the coordinates of the location and as previously mentioned the Place ID we used is the one we had from the Autocomplete query.The returned data will be the expected result according to your question. But feel free to comment if you need anything.
To read more about the
fieldsparameter, refer to the Place Details documentation.I hope this helps!