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

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

问题描述

是否可以通过网络服务访问 Google 提供的流量数据?

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

似乎有一个 GTrafficOverlay 将流量置于嵌入式谷歌地图上的路线之上,但没有我可以使用的直接网络服务,例如,提供源和目的地以及找到它们之间的流量?

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?

推荐答案

没有办法(或至少没有相当简单方便的方法)从 Google Maps Javascript API v3 获取原始交通数据.即使您可以这样做,这样做也可能违反 Google 地图服务条款中的某些条款.您必须从其他服务中获取此信息.我怀疑目前是否有提供此信息的免费服务,但如果有人证明我错了,我会很高兴.

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.

正如@crdzoba 指出的那样,Bing Maps API 会公开一些交通数据.也许这可以满足您的需求.从文档中不清楚暴露了多少流量数据,因为它只是关于事件"的数据.那里会因为施工而导致交通缓慢,但我不清楚是否会因为交通量而导致交通缓慢.

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.

更新(2016 年 3 月):自 2011 年撰写此答案以来发生了很多事情,但核心观点似乎站得住脚:您不会在 免费中找到原始流量数据 API 服务(至少不适用于美国,也可能不适用于大多数其他地方).但是,如果您不介意多付一点钱和/或如果您只需要诸如考虑交通的特定路线的旅行时间"之类的东西,您可以选择.例如,@Anto 的回答 指向 Google 的 Maps For Work 作为付费 API 服务,可让您在考虑交通情况的情况下获取旅行时间.

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.

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

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