谷歌的地方API中过滤建筑类型 [英] Filtering building types in the Google Places API

查看:144
本文介绍了谷歌的地方API中过滤建筑类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我开发我想找到当前位置附近的酒吧一个Android应用程序。这排在我的脑海里使用的第一件事是使用谷歌Places API的谷歌的地方。

for an android application I am developing I want to find nearby pubs of the current location. The first thing that came in my mind to use was google places using the google places api.

于是找了docoumentation后,我做了一个简单的测试套件,从API得到的结果都工作正常使用我的API密钥等..然后我试图过滤它,所以它只会显示的酒吧/夜总会。仰视支持的类型列表后(HTTP://$c$c.google.com/intl/nl-NL/apis/maps/documentation/places/supported_types.html)我决定,酒吧,咖啡馆和night_club是这将匹配的酒吧类型。
但应用该过滤器后,才发现像我提供的范围从1 50酒吧。于是,我就希望通过让所有的地方从点50米半径接近,我知道有很多酒吧都。在那里,我注意到大部分的酒吧只是有自带的谷歌地图没有找到酒吧就好了,如果我在菜单中选择酒吧式'建立'但是谷歌的地方应用。
有没有,有一个建议,用什么来随便找个酒吧因为这些类型的过滤似乎不工作的人。还是我错过了什么?

So after looking up the docoumentation I made a simple test suite to get the result from the api all working fine using my API key etc... Then I tried filtering it so it would only show pubs/nightclubs. After looking up the list of supported types (http://code.google.com/intl/nl-NL/apis/maps/documentation/places/supported_types.html) I decided that 'bar', 'cafe' and 'night_club' are types which would match a pub. But after applying that filter it only found like 1 out of 50 pubs in the range I provided. So I tried looking closer by getting all the places in a 50m radius from a point where I know alot of pubs are. There I noticed most pubs just have the type 'establishment' however the google places app that comes with google maps does find the pubs just fine if I select pubs in the menu. Is there anyone that has a suggestion what to use to just find pubs as those types filter don't seem to work. Or did i miss something?

推荐答案

谷歌API的文档,在矛盾 YAP的声明解释管道符号作为一个,而不是作为一个

Google API's documentation, in contradiction to Y.A.P.'s statement explains the pipe symbol to act as an OR and not as an AND:

类型(可选) - 限制的结果,地方匹配指定类型的至少一个。类型应使用管道符号分隔(| 2型| 1型等

types (optional) — Restricts the results to Places matching at least one of the specified types. Types should be separated with a pipe symbol (type1|type2|etc).

HTTP://$c$c.google.com /的API /地图/文档/地/#PlaceSearchRequests

这篇关于谷歌的地方API中过滤建筑类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆