opentripplanner/OpenTripPlanner — pull request #1450 by jmfield2 (2014-07-03 16:25:32+00:00)
Title: A few changes to fix bike rental support

Similar to PR# 1449

+ Add bicycle_rent to available UI transit modes

I'm not sure if adding this to js/otp/locale/English.js is the correct place -- or how far along the system is to enable different transit modes in a modular fashion -- but again, re-add the rented bicycle option so that the routing system will consider bike rental stations that are loaded into the graph.

+ Bind graphService for @Context injection

At least for otp standalone (since tomcat is not yet working with 1.0.x), add the appropriate bind() in the AbstractBinder to inject the graphService where it is needed -- i.e: in api/resource/BikeRental.java -- instead of generating a NPE. If accepted, we can also remove the // FIXME comment there.

+ Parse the JSON id from CityBikes correctly and actually add it to our station list

When changes were made to the way the JSON is parsed into BikeRentalStation objects, somehow the "id" value is expected as a String but given as an integer (without surrounding quotes like name) and so .textValue() was returning null which I believe was causing problems.

Also, re-add the out.add(brStation); code that was not present and thus rendered the entire bike rental code unusable.

I tested this with an OSM extract from Miami and the decobikes API and confirm that it will now route to the available stations.

Any comments or feedback is more than welcome!

Thanks.