Package org.opentripplanner.routing.bike_rental

Examples of org.opentripplanner.routing.bike_rental.BikeRentalStation


        IntersectionVertex v38 = new IntersectionVertex(graph, "Vertex 38", 179, 89);
        IntersectionVertex v40 = new IntersectionVertex(graph, "Vertex 40", 180, 89);
        IntersectionVertex v42 = new IntersectionVertex(graph, "Vertex 42", 180, 90);

        // Bike rental stations for legs 5, 6 and 7, plus initialization
        BikeRentalStation enterPickupStation = new BikeRentalStation();
        BikeRentalStation exitPickupStation = new BikeRentalStation();
        BikeRentalStation enterDropoffStation = new BikeRentalStation();
        BikeRentalStation exitDropoffStation = new BikeRentalStation();

        enterPickupStation.id = "Enter pickup";
        enterPickupStation.name = "Enter pickup station";
        enterPickupStation.x = 180;
        enterPickupStation.y = 90;
View Full Code Here


    public BikeRentalStation makeStation(Map<String, String> attributes) {
        if (!"true".equals(attributes.get("installed"))) {
            return null;
        }
        BikeRentalStation brstation = new BikeRentalStation();
        brstation.id = attributes.get("id");
        brstation.x = Double.parseDouble(attributes.get("long"));
        brstation.y = Double.parseDouble(attributes.get("lat"));
        brstation.name = attributes.get("name");
        brstation.bikesAvailable = Integer.parseInt(attributes.get("nbBikes"));
View Full Code Here

                }
            }
            /* remove existing stations that were not present in the update */
            List<BikeRentalStation> toRemove = new ArrayList<BikeRentalStation>();
            for (Entry<BikeRentalStation, BikeRentalStationVertex> entry : verticesByStation.entrySet()) {
                BikeRentalStation station = entry.getKey();
                if (stationSet.contains(station))
                    continue;
                BikeRentalStationVertex vertex = entry.getValue();
                if (graph.containsVertex(vertex)) {
                    graph.removeVertexAndEdges(vertex);
View Full Code Here

    public OVFietsKMLDataSource() {
        super("//*[name()='Placemark']");
    }

    public BikeRentalStation makeStation(Map<String, String> attributes) {
        BikeRentalStation brstation = new BikeRentalStation();
        brstation.id = attributes.get("name")+attributes.get("Point").trim();
        String[] coordinates = attributes.get("Point").trim().split(",");
        brstation.x = Double.parseDouble(coordinates[0]);
        brstation.y = Double.parseDouble(coordinates[1]);
        if ( brstation.x == 0 || brstation.y == 0)
View Full Code Here

        // Jackson ObjectMapper to read in JSON
        // TODO: test against real data
        ObjectMapper mapper = new ObjectMapper();
        for (JsonNode stationNode : mapper.readTree(data)) {
            BikeRentalStation brStation = new BikeRentalStation();
            // We need string IDs but they are in JSON as numbers. Avoid null from textValue(). See pull req #1450.
            brStation.id = String.valueOf(stationNode.get("id").intValue());
            brStation.x = stationNode.get("lng").doubleValue() / 1000000.0;
            brStation.y = stationNode.get("lat").doubleValue() / 1000000.0;
            brStation.name = stationNode.get("name").textValue();
View Full Code Here

    public VCubDataSource() {
        super("//*[name()='ms:CI_VCUB_P']");
    }

    public BikeRentalStation makeStation(Map<String, String> attributes) {
        BikeRentalStation brstation = new BikeRentalStation();
        brstation.id = attributes.get("ms:GID").trim();
        String[] coordinates = attributes.get("ms:msGeometry").trim().split(" ");
        if (coordinates.length >= 2) {
            brstation.x = Double.parseDouble(coordinates[1]);
            brstation.y = Double.parseDouble(coordinates[0]);
View Full Code Here

        }
        if (!attributes.containsKey("Point")) {
            LOG.warn("Missing Point geometry in KML Placemark, cannot create bike rental.");
            return null;
        }
        BikeRentalStation brStation = new BikeRentalStation();
        brStation.name = attributes.get("name").trim();
        if (namePrefix != null)
            brStation.name = namePrefix + brStation.name;
        String[] coords = attributes.get("Point").trim().split(",");
        brStation.x = Double.parseDouble(coords[0]);
View Full Code Here

    public BikeRentalStation makeStation(Map<String, String> attributes) {
        //FIXME: I have no idea what state actually means
        if (!"1".equals(attributes.get("state"))) {
            return null;
        }
        BikeRentalStation brstation = new BikeRentalStation();
        brstation.id = attributes.get("number");
        brstation.x = Double.parseDouble(attributes.get("longitude"));
        brstation.y = Double.parseDouble(attributes.get("latitude"));
        brstation.name = attributes.get("name");
        brstation.bikesAvailable = Integer.parseInt(attributes.get("bikesavailable"));
View Full Code Here

       if (!kioskNode.path("Status").asText().equals("Active")) {
           return null;
       }


       BikeRentalStation brstation = new BikeRentalStation();

       brstation.id = kioskNode.path("Id").toString();
       brstation.x = kioskNode.path("Location").path("Longitude").asDouble();
       brstation.y = kioskNode.path("Location").path("Latitude").asDouble();
       brstation.name =  kioskNode.path("Name").asText();
View Full Code Here

        for (int i = 0; i < rootNode.size(); i++) {
            JsonNode node = rootNode.get(i);
            if (node == null) {
                continue;
            }
            BikeRentalStation brstation = makeStation(node);
            if (brstation != null)
                out.add(brstation);
        }
        synchronized(this) {
            stations = out;
View Full Code Here

TOP

Related Classes of org.opentripplanner.routing.bike_rental.BikeRentalStation

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.