通过Web服务访问Google的流量数据 [英] Access Google's Traffic Data through a Web Service

查看:118
本文介绍了通过Web服务访问Google的流量数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以访问Google通过网络服务提供的流量数据?



似乎有一个 GTrafficOverlay 将流量置于嵌入式谷歌地图上的路线之上,但是没有我可以使用的直接Web服务,例如,给出源和目的地并查找它们之间的流量?

有没有其他的来源可以获取这些数据?

解决方案

(或者至少没有合理简单便捷的方式)从Google Maps Javascript API v3获取原始流量数据。即使您可以这样做,也可能违反Google地图服务条款中的某些条款。你将不得不从另一个服务获取这些信息。我怀疑目前有免费服务提供这些信息,但如果有人证明我错了,我会很喜欢它。

正如@crdzoba指出的那样, Bing Maps API公开一些流量数据。也许这可以满足你的需求。从文档中不清楚有多少流量数据暴露出来,因为它只是关于事件的数据。由于建设缓慢的交通将在那里,但它对我来说是不是很明显是否由于交通量的减少而导致交通量减少。

更新(2016年3月):有很多因为这个答案是在2011年编写的,但核心点似乎仍然存在:您在免费 API服务中找不到原始流量数据(至少不是美国,可能不是大多数其他地方)。但是,如果您不介意支付一点费用和/或如果您只需要诸如考虑流量的特定路线的行程时间等事项,则可以选择。例如, @ Anto的回答指向 Google的Maps for Work 作为付费API服务,可让您将旅行时间考虑在流量中。


Is there a way I can access traffic data that Google provides through a web service?

There seems to be a GTrafficOverlay that puts traffic on top of a route on an embedded google map, but no direct web service that I can consume to, say, give the source and the destination and find the traffic between them?

Is there any other source I can get this data from?

解决方案

There is no way (or at least no reasonably easy and convenient way) to get the raw traffic data from Google Maps Javascript API v3. Even if you could do it, doing so is likely to violate some clause in the Terms Of Service for Google Maps. You would have to get this information from another service. I doubt there is a free service that provides this information at the current time, but I would love it if someone proved me wrong on that.

As @crdzoba points out, Bing Maps API exposes some traffic data. Perhaps that can fill your needs. It's not clear from the documentation how much traffic data that exposes as it's only data about "incidents". Slow traffic due to construction would be in there, but it's not obvious to me whether slow traffic due simply to volume would be.

UPDATE (March 2016): A lot has happened since this answer was written in 2011, but the core points appear to hold up: You won't find raw traffic data in free API services (at least not for the U.S., and probably not most other places). But if you don't mind paying a bit and/or if you just need things like "travel time for a specific route taking traffic into consideration" you have options. @Anto's answer, for example, points to Google's Maps For Work as a paid API service that allows you to get travel times taking traffic into consideration.

这篇关于通过Web服务访问Google的流量数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆