Google Map Geocode API returns only top 6 results...How do I get more?

Go To StackoverFlow.com

0

I am using the following uri's to connect to Google Api from a C# class. I left the address that I am currently having trouble with in it as an example.

http://maps.googleapis.com/maps/api/geocode/xml?address=Mt%20Vernon&sensor=false

http://maps.googleapis.com/maps/api/geocode/xml?address=Mt%20Vernon,%20IN&sensor=false

The first link only returns what appears to be the top 6 results. The second link is the result I actually need. I understand that I can force the user to supply the state, but the requirements that I am under are explicit that only the city need be entered.

I have searched for a way to increase the result set to no avail. At this point I am looking for any ideas short of switching to some other services (which I am not opposed to if google, indeed has this short coming).

Thanks for whatever help you might be able to provide.

2012-04-03 20:26
by bennyB
I have a suggestion that will only help if you're limiting the searches to only one state, say Indiana. Behind the scenes, just add " Indiana - United States" to the user-supplied text. It doesn't seem to hurt if the user does enter the state name. I just don't see any way for Google Maps to guess which state the user means. I'm curious if there's a real answer - Heitor Chang 2012-04-03 20:38
Possible duplicate of Geocoding ambiguous addresses with google maps APImiguev 2016-06-29 12:25


0

If you include USA in your search parameter, the Mt. Vernon result from Indiana is included:

http://maps.googleapis.com/maps/api/geocode/xml?address=Mt%20Vernon,USA&sensor=false

Not sure if it helps any, since it may have a different behavior with a different query, but it does satisfy the original issue.

2012-04-03 22:29
by javram
it does help this particular situation with that specific city. But to further complicate the issue, the addresses that might be searched include Canada and or Mexico. So the real query: is there a way to tell Google map api to change the max result set from 6 to some other arbitrary number - bennyB 2012-04-04 15:26
Ads