无法按类别过滤here.com自动建议API

时间:2019-03-19 15:58:02

标签: here-api

我正在here.com中尝试自动建议api的位置,但是按education-facility类别进行过滤似乎无效:

https://places.cit.api.here.com/places/v1/autosuggest?app_id=...&q=strathcona&app_code=...&at=53.631611,-113.323975&category=education-facility

here.com categories documentation对于支持什么和不支持什么尚不清楚,但是似乎我应该可以使用education-facility。而且从文档中还不清楚我应该使用单词Educational Facility,还是应该使用规范的education-facility。实际上,即使明确支持的类别,例如restaurant似乎也没有作用。

因为stack overflow is the place for tech support而在此处发布。

编辑:通过“似乎无效”,我应该指定自己没有看到任何学校,只有city-town-villageadministrative-region等类别, airport

1 个答案:

答案 0 :(得分:0)

对Places(Search)API的请求包括基本元素,例如基本URL和路径名,此外可能包含特定于资源的参数。 url中特定于资源的参数可以是自动建议(您使用过的)或类别/位置(以及更多),请参阅developer.here.com/documentation/places/topics/request-constructing.html

可以在autosuggest API中传递的属性可以从以下引用: developer.here.com/documentation/places/topics_api/media-type-autosuggest.html

例如在建议的地方 您可以像下面那样使用category和categoryTitle。规范形式以及在不同类别选项中指定的本地类别名称也可以使用(developer.here.com/documentation/places/topics/place_categories/places-category-system.html)

类别字符串; (可选)-该地点的类别ID或名称。

categoryTitle 字符串-类别的(本地化)显示名称。例如,饮食。

Rest URL中自动建议资源类型的唯一必需属性是

1) q :这是搜索文本 2) at :指定纬度和经度

对于API中的自动建议资源类型:

https://places.cit.api.here.com/places/v1/autosuggest?app_id=xxxxxx&app_code=yyyyyyy&at=53.631611,-113.323975&category=education-facility&q=edu

对于API中的类别资源类型:

https://places.cit.api.here.com/places/v1/categories/places?app_id=xxxxxx&app_code=yyyyyy&categoryId=eat-drink&at=53.631611,-113.323975&category=eat和饮料

相关问题