opentripplanner

Extend Open Trip PLanner function


i'm a developer and i'm working on a app about smart mobility. Into smart mobility i woul like to use a intermodal routing and i have seen that open trip planner is a good open source product to work. I have see that google work in similar way but we prefer open trip planner. Now i woul like to integrate open trip planner with the data of bike sharing or car sharing of my city. So i would like to know if is possible to add car sharing data of my city and configure the open trip planner to calculate a ruote using also this data and not only transit data. Any help? Thanks


Solution

  • OpenTripPlanner has a real time data interface to allow scheduling trips incorporating bike sharing using existing APIs. From the 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.

    Using a KML file like the example in that 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>
    

    Put simply, you will need to add these references to your "router-config.json" file, like:

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