【问题标题】:Listing major hospitals in a city using Google Places API使用 Google Places API 列出城市中的主要医院
【发布时间】:2014-06-05 15:26:10
【问题描述】:
我们刚刚开始使用Google Places API 来显示特定城市的医院。
我们遇到的问题是在使用type 或keyword“医院”时,它会显示各种诊所和医疗中心。
如果我浏览 maps.google.com 并使用 Google 自己的网站搜索“x 市医院”,它只会显示该城市的一家医院。
有没有人对如何过滤和显示单个医院而不是其他较小的中心有任何建议?
【问题讨论】:
标签:
google-maps
google-maps-api-3
google-places-api
【解决方案1】:
您可以使用rankby 参数的prominence 选项来获取按其在该区域中的重要性排列的结果。在医院的情况下,这很可能会返回城镇/城市的主要医院作为第一选择。其他选项将按显着程度的降序排列,因此您可以检查每个地名以查找包含“诊所”、“医疗中心”、“GP”等单词的第一个选项,然后将列表剪切到那里。
rankby — Specifies the order in which results are listed. Possible values are:
prominence (default). This option sorts results based on their importance.
Ranking will favor prominent places within the specified area. Prominence
can be affected by a Place's ranking in Google's index, the number of check-
ins from your application, global popularity, and other factors.
Places Search documentation