【问题标题】:Is there a Google Transit API available? [closed]是否有可用的 Google Transit API? [关闭]
【发布时间】:2012-03-14 12:54:54
【问题描述】:

我正在开发适用于 Android 和 iOS 的移动应用。客户是一家公共交通公司,他们要求我们集成 Google Transit。

是否有可用于 Google Transit 的 API?这会让我们很轻松。
谢谢!

【问题讨论】:

    标签: android ios api google-api


    【解决方案1】:

    【讨论】:

    • +1 截至 2012 年,这是正确答案。
    【解决方案2】:

    大多数旅行社不允许 Google 将其数据作为公共 API 公开。因此,没有“简单”且可靠的方式来集成 Google Transit。

    但是,至少有一种更困难的方法可以做到这一点:使用特殊查询参数请求 maps.google.com,然后解析带有嵌入 HTML 的类似 JSON 的字符串。 您可以查看我的博客文章以了解此选项的一些介绍: http://mikhail.io/2012/04/10/google-transit-api-research/

    我不在那里分享任何代码,但任务是可行的。

    【讨论】:

    • 欢迎您!不错的答案,继续加油!
    【解决方案3】:

    有供开发人员使用的供稿和供交通机构上传交通数据的端点: https://developers.google.com/transit/

    这里有一些例子: https://developers.google.com/transit/gtfs/examples/

    【讨论】:

      【解决方案4】:

      您可以只使用 Google 的 Directions API。它将所有传输(计划或实时)数据合并到结果中,通过 JSON 返回给您的应用程序。

      https://developers.google.com/maps/documentation/directions/

      进行http API查询并传入起点和终点,打开transit,它将返回您可以解析的JSON。

      http://maps.googleapis.com/maps/api/directions/json?origin=1500+Goddard+Avenue%2C+Louisville%2C+KY&destination=2100+S+Preston+St.%2CLouisville%2CKY&sensor=true&arrival_time=1396696559&mode=transit

      注意'mode'参数等于'transit'。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-08-21
        • 2011-09-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-06
        相关资源
        最近更新 更多