【问题标题】:HERE traffic api - Getting historical traffic dataHERE 交通 api - 获取历史交通数据
【发布时间】:2021-09-07 14:54:52
【问题描述】:

我想获取特定时间的交通数据地图图块。去做这个, 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 是否损坏?它适用于实时交通数据,但在我指定时间时会出现问题。

【问题讨论】:

    标签: here-api traffic here-maps-rest heremaps here-traffic


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      为满足您的要求,您不应使用 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

      【讨论】:

      • 感谢您的回答。但是,当我编辑我的问题并添加响应图片时,这里的 API 总是返回一个类似的交通图块,它们与我从实时 API 获得的交通图块数据不同。我认为获取历史数据有问题。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-10-21
      • 1970-01-01
      • 1970-01-01
      • 2012-04-26
      • 1970-01-01
      • 2021-06-28
      • 2020-12-24
      相关资源
      最近更新 更多