扩展 Open Trip PLANNER 功能

Extend Open Trip PLanner function

我是一名开发人员,我正在开发一款关于智能出行的应用程序。 在智能出行方面,我想使用多式联运路线,而且我已经看到 open trip planner 是一个很好的开源产品。我看到 google 以类似的方式工作,但我们更喜欢开放式旅行计划。 现在我想将 open trip planner 与我所在城市的自行车共享或汽车共享数据集成。 所以我想知道是否可以添加我所在城市的汽车共享数据并配置开放式旅行计划器以使用此数据计算路线,而不仅仅是交通数据。 有什么帮助吗? 谢谢

OpenTripPlanner 有一个 real time data 接口,允许使用现有 API 安排包含自行车共享的行程。来自 link:

Besides GTFS-RT transit data, OTP can also fetch real-time data about bicycle rental networks including the number of bikes and free parking spaces at each station. We support bike rental systems from JCDecaux, BCycle, VCub, Keolis, Bixi, the Dutch OVFiets system, ShareBike and a generic KML format. It is straightforward to extend OTP to support any bike rental system that exposes a JSON API or provides KML place markers, though it requires writing a little code.

使用类似于示例中的 KML 文件 link:

<?xml version="1.0" encoding="utf-8" ?>
    <kml xmlns="http://www.opengis.net/kml/2.2">
    <Document id="root_doc">
        <Schema name="citybikes" id="citybikes">
            <SimpleField name="ID" type="int"></SimpleField>
        </Schema>
        <Placemark>
            <name>A Bike Station</name>
            <ExtendedData>
                <SchemaData schemaUrl="#citybikes">
                    <SimpleData name="ID">0</SimpleData>
                </SchemaData>
            </ExtendedData>
            <Point>
                <coordinates>24.950682884886643,60.155923430488102</coordinates>
            </Point>
        </Placemark>
    </Document>
</kml>

简而言之,您需要将这些引用添加到您的 "router-config.json" 文件中,例如:

    <!--- San Francisco Bay Area bike share -->
    {
      "type": "bike-rental",
      "frequencySec": 300,
      "sourceType": "sf-bay-area",
      "url": "http://www.bayareabikeshare.com/stations/json"
    }