2

我想获取特定时间的交通数据地图图块。为此, https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-traffic-flowbasetile.html如文档中所写,我传递了“时间”参数。但是,它看起来无法正常工作。

请求的示例 URL: https ://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey=apikey&ppi=500&time=2021- 08-03T16:00:00Z

在此处输入图像描述

2021-09-21T16:31:00z 实时交通数据的响应。我在 2021-09-21T16:31:00z 这个时间没有传递时间参数就得到了这个结果。

https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey={apikey}&ppi=500

在此处输入图像描述

我传递时间参数时的数据响应。

https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey={apikey}&ppi=500&time=2021-09-21T16:31:00z

当我用我已经保存的响应(当我请求实时流量数据时)测试历史数据响应时,它们并不相同。历史流量数据总是返回类似的响应,几乎没有变化,但它们是不正确的。它甚至会返回 2022 年等未来日期的结果。API 是否损坏?它适用于实时交通数据,但在我指定时间时会出现问题。

4

2 回答 2

1

为满足您的要求,您不应使用 2009 年之前的时间,因为不支持此时间。

带时间参数的响应——

https://1.traffic.maps.ls.hereapi.com/maptile/2.1/traffictile/newest/normal.day/13/4358/2842/512/png?apiKey={YOUR_API_KEY}&ppi=500&time=2021-09-13T16:00:00z

在此处输入图像描述

另请检查文档以供参考。

https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-traffic-traffictile.html

于 2021-09-13T06:37:02.943 回答
1

在 Here Map Tile V2 中,您需要在 2009 年之后传递时间戳,因为不支持 2009 年之前的时间。休息时,历史交通数据磁贴效果很好。

于 2021-09-09T10:47:01.290 回答