【问题标题】:Can't filter here.com autosuggest API by category无法按类别过滤 here.com 自动建议 API
【发布时间】:2019-03-22 13:09:40
【问题描述】:

我正在here.com 中尝试使用places autosuggest 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-regionairport 等类别.

【问题讨论】:

    标签: here-api


    【解决方案1】:

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

    可以在自动建议API中传递的属性可以参考: developer.here.com/documentation/places/topics_api/media-type-autosuggest.html

    例如。在建议的地方 您可以使用如下所示的类别和类别标题。不同类别选项中指定的规范形式和本地类别名称可以工作(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 喝酒

    【讨论】:

    • 对不起,我应该更明确地说明我所看到的。我的 URL 与您建议的基本相同,但我看到的类别有 city-town-villageadministrative-regionairport 等,但没有学校。我明确地试图找到存在于这些坐标附近的已知实体“Strathcona High School”。
    猜你喜欢
    • 2022-01-06
    • 1970-01-01
    • 1970-01-01
    • 2021-06-20
    • 1970-01-01
    • 1970-01-01
    • 2021-05-18
    • 1970-01-01
    • 2021-10-12
    相关资源
    最近更新 更多