Google Maps API: Geocode returns different coordinates, and Google maps

I'm currently trying to geocode addresses, but I am having trouble getting the exact coordinates. For example, if I enter the address into Google maps, it displays correctly, but if I geocode the same address, I get only the APPROXIMATE location type from the geocode json code response and other coordinates.

What causes the mismatch, and is there anything I can do to improve the accuracy of my geocoding, to go to the level of address search in manual Google search?

+4
source share
1 answer

Try adding a country to the request. From Fonthill Road, Lucan, Dublin, it gives different results:

Note. I use Fonthill Road, Lucan, Dublin. Thus, placing an area in a request makes a huge difference in the size of the response. Geocode -6.4059442, 53.3473048 is very close to Unit 1, Fonthill Retail Park, Lucan, Co. Dublin.

My conclusion: you need to compare the name and address, because the result of your query:

"name": "Fonthill Retail Park, Lucan, Co. Dublin, Ie", "address": "Lucan, Co. Dublin, Ireland",

and therefore there is no Fonthill mall on Google, so the reverse geocode is Lucan, Dublin, and that’s exactly what you find on the map!?!

In my example, I use the address Fonthill Road ..., the result gives

"name": "Fonthill Road, Lucan, Dublin, Ie" and address: "address": "Fonthill Rd N, Dublin, Co. Dublin, Irland",

which is exactly the same and the geocode also shows the correct location, but I’m not sure that the region is so important, I’m probably wrong, but I think you need to go through the answer if you want to increase your accuracy anyway?

Have you read: https://developers.google.com/maps/documentation/geocoding/index#RegionCodes ?

0
source

Source: https://habr.com/ru/post/1438497/


All Articles