Discover/Autosuggest和calculateroute API不会返回从同一点a到同一点b的相同距离



我一直在使用Here Maps API,在测试API时,我注意到使用discover和autosuggest API从a点到B点的距离的结果与calculateroute API 给出的结果不同

这里有一个例子:

以下是自动建议API返回的内容https://autosuggest.search.hereapi.com/v1/autosuggest?at=34.7505979,10.71047164&limit=5&lang=en&q=医学因素&apiKey=";Your_ API_密钥";

{
"title": "Faculté de Médecine",
"id": "here:pds:place:788jx7ps-886689ec55920a84c15752902c00f8e9",
"resultType": "place",
"address": {
"label": "Faculté de Médecine, Avenue Majida Boulila, Sfax, Tunisia"
},
"position": {
"lat": 34.73924,
"lng": 10.75122
},
"access": [
{
"lat": 34.73924,
"lng": 10.75122
}
],
"distance": 3932,
"categories": [
{
"id": "800-8200-0173",
"name": "Higher Education",
"primary": true
}
],
"references": [
{
"supplier": {
"id": "core"
},
"id": "1126185297"
}
],
"highlights": {
"title": [
{
"start": 0,
"end": 19
}
],
"address": {
"label": [
{
"start": 0,
"end": 19
}
]
}
}
},

正如你所看到的,API返回距离=3932

发现API也是一样:https://discover.search.hereapi.com/v1/discover?at=34.7505979,10.71047164&limit=5&q=药物浓度&apiKey=";Your_ API_;它返回以下结果:

{
"title": "كلية الطب (Faculté de Médecine)",
"id": "here:pds:place:788jx7ps-886689ec55920a84c15752902c00f8e9",
"resultType": "place",
"address": {
"label": "كلية الطب, شارع ماجدة بو ليلى, صفاقس, تونس",
"countryCode": "TUN",
"countryName": "تونس",
"county": "صفاقس",
"city": "صفاقس",
"district": "صفاقس المدينة",
"street": "شارع ماجدة بو ليلى"
},
"position": {
"lat": 34.73924,
"lng": 10.75122
},
"access": [
{
"lat": 34.73924,
"lng": 10.75122
}
],
"distance": 3932,
"categories": [
{
"id": "800-8200-0173",
"name": "تعليم عالي",
"primary": true
}
],
"references": [
{
"supplier": {
"id": "core"
},
"id": "1126185297"
}
]
},

距离是3932太

而当使用计算路由API时:https://route.api.here.com/routing/7.2/calculateroute.json?app_id="Your_APP_ID"&app_ code=";Your_APP_CODE"&waypoint0=地理!34.7505979,10.71047164&waypoint1=地理!34.73924,10.75122&mode=最快;汽车流量:已启用&lang=fr

它返回

"summary": {
"distance": 4800,
"trafficTime": 692,
"baseTime": 692,
"flags": [
"builtUpArea"
],
"text": "The trip takes <span class="length">4.8 km</span> and <span class="time">12 mins</span>.",
"travelTime": 692,
"_type": "RouteSummaryType"
}
}

所以这里的距离是4800

所以,我的问题是,这是一种错误,还是我错过了什么?

Autosuggest API请求响应中的"距离"不考虑任何路由和流量参数。因此,距离计算为从A点到B点的距离。

详细信息:https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-autosuggest-brief.html

但在计算路线响应中存在"距离"的情况下,它会考虑交通方式、交通条件以及其他路线参数。

https://route.api.here.com/routing/7.2/calculateroute.json?app_id="Your_APP_ID"&app_ code=";Your_APP_CODE"&waypoint0=地理!34.7505979,10.71047164&waypoint1=地理!34.73924,10.75122&mode=最快;汽车流量:已启用&lang=fr

详细信息:https://developer.here.com/documentation/routing-api/8.22.2/dev_guide/topics/send-request.html

相关内容

最新更新