2

我想根据我的谷歌电子表格中的当前天气/交通状况,根据开始时间计算两个地点之间的旅行时间。格式是这样的:

开始地点 结束地点 开始时间 预计行程时间

我正在使用 Mapquest Api

=importXML("http://mapquestapi.com/directions/v1/route?key=APIKEY&outFormat=xml&from=" & A2 & "&to=" & B2,"//response/route/formattedTime")

但它给了我一个不正确的旅行时间,而且旅行时间不是实时的(基于我的开始时间)。还有另一种方法可以实现这一目标吗?
编辑:距离矩阵 API 是我遇到的,但不知道如何集成到 Google 电子表格中。有没有办法通过谷歌脚本在那里使用它?

4

1 回答 1

0

Can you post an example with the locations that is not producing the expected travel time?

There are two types of time returned by the directions request: time and realTime. Time is purely mathematical given the distance, speed limit, and some penalties for maneuvers. The realTime is the time with traffic where available.

于 2016-07-18T16:02:38.460 回答