开发者

Google Maps geocoder for venues

开发者 https://www.devze.com 2023-02-19 09:30 出处:网络
I\'m searching for a way to geocode venues with google maps. The Geocoder API only provides the ability to use addresses for geocoding. But what if don\'t know the address and only the city and the na

I'm searching for a way to geocode venues with google maps. The Geocoder API only provides the ability to use addresses for geocoding. But what if don't know the address and only the city and the name of the restaurant? Or I want to retrieve results for "Mc Donalds Berlin" or just "Bar Berlin"?

I've found this post where he asks exactly what I need: Suggest list in google maps search input

And at his blog I found a solution

This works very well and its incredible fast! I've checked out the source code and saw that he is using this URL:

http://maps-api-ssl.google.com/maps/suggest?hl=en&gl=us&v=2&json=b&auth=4c8b041euWw4-3h2-Ty2fD3D开发者_如何学Python1BKVQqJCEcU&src=1,2&num=5&numps=5&callback=handleResponse&q=........

Btw, it's the same URL that maps.google.com uses to get their ajax autocompletion.

My questions now are:

  • Is it allowed to use this URL for my own website?
  • Do I need a special API key? (because of the auth= var in the URL above)
  • Or is it sth like a paid service?
  • Are there any other ways to get the problem solved? e.g. with the standard Geocoder API from google?


You might want to take a look into Google Places API for Venues:

Google Places API

Another way to do it is through YQL, but i am not 100% sure on the accuracy of it. Go to YQL Console and try the following query:

select * from local.search where query="outback steakhouse" and location="atlanta, ga"

This would give you locations of Outback steakhouse in Atlanta, GA. Also you can query resturants near a zipcode:

select * from local.search where zip='30045' and query='restaurant'

I am sure there are ways to query venues around a given point using YQL.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号