Package org.opentripplanner.routing.bike_park

Examples of org.opentripplanner.routing.bike_park.BikePark


                }
            }
            /* Remove existing parks that were not present in the update */
            List<BikePark> toRemove = new ArrayList<BikePark>();
            for (Entry<BikePark, BikeParkVertex> entry : verticesByPark.entrySet()) {
                BikePark bikePark = entry.getKey();
                if (bikeParkSet.contains(bikePark))
                    continue;
                BikeParkVertex vertex = entry.getValue();
                if (graph.containsVertex(vertex)) {
                    graph.removeVertexAndEdges(vertex);
View Full Code Here


        xmlDownloader
                .setPath("//*[local-name()='kml']/*[local-name()='Document']/*[local-name()='Placemark']");
        xmlDownloader.setDataFactory(new XmlDataListDownloader.XmlDataFactory<BikePark>() {
            @Override
            public BikePark build(Map<String, String> attributes) {
                BikePark bikePark = new BikePark();
                if (!attributes.containsKey("name")) {
                    LOG.warn("Missing name in KML Placemark, cannot create bike park.");
                    return null;
                }
                if (!attributes.containsKey("Point")) {
View Full Code Here

        ShortestPathTree tree = aStar.getShortestPathTree(options);
        GraphPath path = tree.getPath(D, false);
        assertNull(path);

        // So we add a bike P+R at C.
        BikePark bpc = new BikePark();
        bpc.id = "bpc";
        bpc.name = "Bike Park C";
        bpc.x = 0.002;
        bpc.y = 45.00001;
        bpc.spacesAvailable = 1;
View Full Code Here

        List<BikePark> bikeParks = kmlDataSource.getBikeParks();
        assertEquals(5, bikeParks.size());
        for (BikePark bikePark : bikeParks) {
            System.out.println(bikePark);
        }
        BikePark alkmaar = bikeParks.get(0);
        BikePark zwolle = bikeParks.get(4);
        assertEquals("Station Alkmaar", alkmaar.name);
        assertEquals("Station Zwolle", zwolle.name);
        assertTrue(alkmaar.x >= 4.739850 && alkmaar.x <= 4.739851);
        assertTrue(alkmaar.y >= 52.637531 && alkmaar.y <= 52.637532);
        assertTrue(zwolle.x >= 6.091060 && zwolle.x <= 6.091061);
View Full Code Here

            for (OSMNode node : osmdb.getBikeParkingNodes()) {
                n++;
                String creativeName = wayPropertySet.getCreativeNameForWay(node);
                if (creativeName == null)
                    creativeName = "P+R";
                BikePark bikePark = new BikePark();
                bikePark.id = "" + node.getId();
                bikePark.name = creativeName;
                bikePark.x = node.lon;
                bikePark.y = node.lat;
                bikeRentalService.addBikePark(bikePark);
View Full Code Here

            for (Ring ring : area.outermostRings) {
                for (OSMNode node : ring.nodes) {
                    envelope.expandToInclude(new Coordinate(node.lon, node.lat));
                }
            }
            BikePark bikePark = new BikePark();
            bikePark.id = "" + osmId;
            bikePark.name = creativeName;
            bikePark.x = (envelope.getMinX() + envelope.getMaxX()) / 2;
            bikePark.y = (envelope.getMinY() + envelope.getMaxY()) / 2;
            bikeRentalService.addBikePark(bikePark);
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.bike_park.BikePark

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.