Discover / Autosuggest 和 calculateroute API 不 return 从同一点 a 到同一点 b 的相同距离
Discover / Autosuggest and calculateroute APIs do not return the same distance from the same point a to the same point b
我一直在使用 Here Maps APIs,在测试 APIs 时,我注意到使用发现和自动建议 [=A 点到 B 点的距离结果 APIs 与计算路由给出的结果不同API
这是一个例子:
这是自动建议 API returns https://autosuggest.search.hereapi.com/v1/autosuggest?at=34.7505979,10.71047164&limit=5&lang=en&q=faculté de medecine&apiKey="Your_API_Key"
{
"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 returns 距离 = 3932
discover API 同样的事情:
https://discover.search.hereapi.com/v1/discover?at=34.7505979,10.71047164&limit=5&q=faculte de medecine&apiKey="Your_API_KEY"
它 returns 这个结果 :
{
"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
它returns
"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
所以,我的问题是,这是一种错误,还是我遗漏了什么?
'distance' 在 Autosuggest API 请求的响应中不考虑任何路由和流量参数。所以距离计算为从 A 点到 B 点的距离。
但如果 'distance' 在 calculateroute 的响应中,它会考虑运输方式、交通状况以及其他路由参数。
详情:https://developer.here.com/documentation/routing-api/8.22.2/dev_guide/topics/send-request.html
我一直在使用 Here Maps APIs,在测试 APIs 时,我注意到使用发现和自动建议 [=A 点到 B 点的距离结果 APIs 与计算路由给出的结果不同API
这是一个例子:
这是自动建议 API returns https://autosuggest.search.hereapi.com/v1/autosuggest?at=34.7505979,10.71047164&limit=5&lang=en&q=faculté de medecine&apiKey="Your_API_Key"
{
"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 returns 距离 = 3932
discover API 同样的事情: https://discover.search.hereapi.com/v1/discover?at=34.7505979,10.71047164&limit=5&q=faculte de medecine&apiKey="Your_API_KEY" 它 returns 这个结果 :
{
"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
它returns
"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
所以,我的问题是,这是一种错误,还是我遗漏了什么?
'distance' 在 Autosuggest API 请求的响应中不考虑任何路由和流量参数。所以距离计算为从 A 点到 B 点的距离。
但如果 'distance' 在 calculateroute 的响应中,它会考虑运输方式、交通状况以及其他路由参数。
详情:https://developer.here.com/documentation/routing-api/8.22.2/dev_guide/topics/send-request.html