Google 地图矩阵 API 返回 status:ZERO_RESULTS 英国邮政编码
Google Maps Matrix API returning status:ZERO_RESULTS UK postcodes
我正在使用地图矩阵 api 查找英格兰各地点之间的交通距离。
https://maps.googleapis.com/maps/api/distancematrix/json?
units=metric
&key=YOUR_KEY_HERE
&origins=SE108aJ
&destinations=SE164UN
&mode=transit
&arrival_time=1568618400
®ion=UK
它returns:
{
"destination_addresses" : [ "London SE16 4UN, UK" ],
"origin_addresses" : [ "Dartmouth Hill, Blackheath, London SE10 8AJ, UK" ],
"rows" : [
{
"elements" : [
{
"status" : "ZERO_RESULTS"
}
]
}
],
"status" : "OK"
}
对 Google 地图的相同请求有效:
https://www.google.com/maps/dir/SE10+8AJ,+Dartmouth+Hill,+Blackheath,+London/London+SE16+4UN
所以我有点困惑为什么 API 调用没有
找到了,我已经包含了过去的到达时间,将其更改为未来的时间和日期使其可以正常工作。
2019-09-16 08:20:00 格林威治标准时间 == 1568618400
现在 == 1573060070
2019-11-16 08:20:00 格林威治标准时间 == 1573892400
https://maps.googleapis.com/maps/api/distancematrix/json?
units=metric
&key=YOUR_KEY_HERE
&origins=SE108aJ
&destinations=SE164UN
&mode=transit
&arrival_time=1573892400
®ion=UK
结果:
{
"destination_addresses" : [ "London SE16 4UN, UK" ],
"origin_addresses" : [ "Dartmouth Hill, Blackheath, London SE10 8AJ, UK" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "9.1 km",
"value" : 9143
},
"duration" : {
"text" : "41 mins",
"value" : 2481
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
我正在使用地图矩阵 api 查找英格兰各地点之间的交通距离。
https://maps.googleapis.com/maps/api/distancematrix/json?
units=metric
&key=YOUR_KEY_HERE
&origins=SE108aJ
&destinations=SE164UN
&mode=transit
&arrival_time=1568618400
®ion=UK
它returns:
{
"destination_addresses" : [ "London SE16 4UN, UK" ],
"origin_addresses" : [ "Dartmouth Hill, Blackheath, London SE10 8AJ, UK" ],
"rows" : [
{
"elements" : [
{
"status" : "ZERO_RESULTS"
}
]
}
],
"status" : "OK"
}
对 Google 地图的相同请求有效:
https://www.google.com/maps/dir/SE10+8AJ,+Dartmouth+Hill,+Blackheath,+London/London+SE16+4UN
所以我有点困惑为什么 API 调用没有
找到了,我已经包含了过去的到达时间,将其更改为未来的时间和日期使其可以正常工作。
2019-09-16 08:20:00 格林威治标准时间 == 1568618400
现在 == 1573060070
2019-11-16 08:20:00 格林威治标准时间 == 1573892400
https://maps.googleapis.com/maps/api/distancematrix/json?
units=metric
&key=YOUR_KEY_HERE
&origins=SE108aJ
&destinations=SE164UN
&mode=transit
&arrival_time=1573892400
®ion=UK
结果:
{
"destination_addresses" : [ "London SE16 4UN, UK" ],
"origin_addresses" : [ "Dartmouth Hill, Blackheath, London SE10 8AJ, UK" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "9.1 km",
"value" : 9143
},
"duration" : {
"text" : "41 mins",
"value" : 2481
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}