I plot locations of real estate on a map. The address listed below is mapped incorrectly because it is a new build and I assume the street and everything is a new build, which is the reason Google can't find it in it's database.
What I want to happen is Google return "GeocoderStatus.ZERO_RESULTS" and not just pick a location with a related name and give me those coords.
The address I'm plotting is:
14018 Lonecreek Ave Orlando, Florida 32828
If you submit the request via http, you get the same results i get through the API, see this link:
You'll see it es back with "Lone Hill Drive" which is incorrect location. How can I tell Google return ZERO_RESULTS status in this instance?
I plot locations of real estate on a map. The address listed below is mapped incorrectly because it is a new build and I assume the street and everything is a new build, which is the reason Google can't find it in it's database.
What I want to happen is Google return "GeocoderStatus.ZERO_RESULTS" and not just pick a location with a related name and give me those coords.
The address I'm plotting is:
14018 Lonecreek Ave Orlando, Florida 32828
If you submit the request via http, you get the same results i get through the API, see this link: http://maps.googleapis./maps/api/geocode/json?address=140
You'll see it es back with "Lone Hill Drive" which is incorrect location. How can I tell Google return ZERO_RESULTS status in this instance?
Share Improve this question asked Oct 23, 2013 at 15:48 RickettsRicketts 5,2234 gold badges36 silver badges48 bronze badges 2- support.google./maps/answer/162873?hl=en – Andy Commented Oct 23, 2013 at 15:52
- When you get the results you can loop through ponents to see if the type is street? – ediblecode Commented Oct 23, 2013 at 15:56
2 Answers
Reset to default 5Google's geocoding process isn't perfect (none are.)
What you can check for is the result's geometry.location_type
property and test if it's value is "APPROXIMATE"
to see if you can trust the returned lat/lng. Read more in the Documentation.
If it's way off you can report it directly to google.
You can use the API's Component Filtering to filter the results by a specific postcode. In such cases a non-exact match will have location_type
of "APPROXIMATE"
rather than the "GEOMETRIC_CENTER"
you were seeing before.
http://maps.googleapis./maps/api/geocode/json?address=[address]&ponents=postal_code:[postcode]&sensor=false
Here's your geocoding request WITH ponent filtering and WITHOUT ponent filtering