Skip to content
novalis edited this page May 11, 2012 · 14 revisions

OTP supports dynamic bike rental/bike sharing systems like Bixi.

To use it, edit your application-context.xml thus:

<bean id="periodicGraphUpdater" class="org.opentripplanner.api.servlet.PeriodicGraphUpdater">
    <property name="updaters">
        <list>
            <bean class="org.opentripplanner.updater.bike_rental.BikeRentalUpdater">
                <property name="bikeRentalDataSource">
                    <bean class="org.opentripplanner.updater.bike_rental.KeolisRennesBikeRentalDataSource">
                        <property name="url" value="[some URL]" />
                    </bean>
                </property>
            </bean>
         </list>
     </property>
</bean>

If you already have a periodic updater for GTFS-realtime, you can just add the bike rental updater to that.

We support two bike rental APIs at present: KeolisRennesBikeRentalDataSource, and BixiBikeRentalDataSource (used in DC, for instance). Just change the class and URL above.

If your city's bike rental API is anything like Bixi or Keolis, it's trivial to add support for it.

If your city's bike rental API is like Velib (with a separate query needed for availability data, for no good reason), I would recommend simply not providing any availability data and assuming that all stops are available for pickup/dropoff. We haven't implemented Velib as apparently the people who run it get cranky when people use their API.

Realtime availability is only used for trips planned for times near now anyway; for future trips, we assume that everything is available.

You can also enable static bike rental data from OSM at graph build time, if you prefer. Just set the staticBikeRental property on OpenStreetMapGraphBuilderImpl to true, and OTP will do the rest.

When building your graph, you can also describe a bike rental system's fare structure. Here's an example:

<bean class="org.opentripplanner.graph_builder.impl.FareServiceGraphBuilderImpl" id ="fareBuilder">
  <property name="service">
    <bean class="org.opentripplanner.routing.bike_rental.TimeBasedBikeRentalFareService">
      <property name="currency" value="USD" />
      <property name="pricing">
        <list value-type="java.lang.String">
          <value>30:00,0</value>
          <value>1:00:00,200</value>
          <value>24:00:00,9400</value>
        </list>
      </property>
    </bean>
  </property>
</bean>

This says that trips 30 minutes or less are free; trips of an hour or less cost $2, and trips less than 24 hours cost $94. Later, we'll probably add support for cost-per-minute systems.

The documentation on this wiki is outdated and should not be used

unless you are intentionally working with legacy versions of OpenTripPlanner. Please consult the current documentation at readthedocs

Clone this wiki locally