Search all places in given city name

北城余情 提交于 2019-11-27 16:50:34

问题


Right now i am using Google Places API for fetching Restaurant list in particular city, query like

https://maps.googleapis.com/maps/api/place/textsearch/xml?query=restaurants+in+Sydney&sensor=true&key=AddYourOwnKeyHere

But the problem here is that we can only have 20 result and with help of next_page_token in the response we can again fetch 20 more, by this we can only have 60 result.

Mention on Google Places API page

The maximum number of results that can be returned is 60

So is there any other authentic way to fetch all the Restaurant details.

Just for information : I am implementing this in android application.


回答1:


Searches are performed by looking within a radius of a given set of coordinates (you can't search just by city name). The maximum search radius is 50km. If there's more than 60 results in that area, you could reduce your search radius, then split up the query into multiple calls. I'm not sure if it would be appropriate to have the user fetch that much data on a mobile device all at once, though.




回答2:


Can you use a different location api like MapQuest's or Bing's? As far as I know MapQuest does not have a transactional limit for the community license (open data). I don't think there's a limit to the number of results returned other than the ones you impose in your query.



来源:https://stackoverflow.com/questions/12024394/search-all-places-in-given-city-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!