Search in sources :

Example 1 with BikeParkEdge

use of org.opentripplanner.routing.edgetype.BikeParkEdge in project OpenTripPlanner by opentripplanner.

the class BikeParkModule method buildGraph.

@Override
public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {
    LOG.info("Building bike parks from static source...");
    BikeRentalStationService service = graph.getService(BikeRentalStationService.class, true);
    if (!dataSource.update()) {
        LOG.warn("No bike parks found from the data source.");
        return;
    }
    Collection<BikePark> bikeParks = dataSource.getBikeParks();
    for (BikePark bikePark : bikeParks) {
        service.addBikePark(bikePark);
        BikeParkVertex bikeParkVertex = new BikeParkVertex(graph, bikePark);
        new BikeParkEdge(bikeParkVertex);
    }
    LOG.info("Created " + bikeParks.size() + " bike parks.");
}
Also used : BikeParkVertex(org.opentripplanner.routing.vertextype.BikeParkVertex) BikeParkEdge(org.opentripplanner.routing.edgetype.BikeParkEdge) BikeRentalStationService(org.opentripplanner.routing.bike_rental.BikeRentalStationService) BikePark(org.opentripplanner.routing.bike_park.BikePark)

Aggregations

BikePark (org.opentripplanner.routing.bike_park.BikePark)1 BikeRentalStationService (org.opentripplanner.routing.bike_rental.BikeRentalStationService)1 BikeParkEdge (org.opentripplanner.routing.edgetype.BikeParkEdge)1 BikeParkVertex (org.opentripplanner.routing.vertextype.BikeParkVertex)1