Package org.onebusaway.transit_data_federation.model

Examples of org.onebusaway.transit_data_federation.model.ShapePointsFactory


    StopTimeEntriesFactory factory = new StopTimeEntriesFactory();
    factory.setDistanceAlongShapeLibrary(new DistanceAlongShapeLibrary());

    List<StopTime> stopTimes = Arrays.asList(stA, stB, stC);

    ShapePointsFactory shapePointsFactory = new ShapePointsFactory();
    shapePointsFactory.addPoint(47.673840100841396, -122.38756621771239);
    shapePointsFactory.addPoint(47.668667271970484, -122.38756621771239);
    shapePointsFactory.addPoint(47.66868172192725, -122.3661729186096);
    ShapePoints shapePoints = shapePointsFactory.create();

    List<StopTimeEntryImpl> entries = factory.processStopTimes(graph,
        stopTimes, tripEntry, shapePoints);

    assertEquals(stopTimes.size(), entries.size());
View Full Code Here


    BufferedReader reader = new BufferedReader(
        new InputStreamReader(getClass().getResourceAsStream(
            "DistancesAlongShapeLibraryTest-" + key)));
    String line = null;
    ShapePointsFactory factory = new ShapePointsFactory();

    while ((line = reader.readLine()) != null) {
      String[] tokens = line.split(" ");
      double lat = Double.parseDouble(tokens[0]);
      double lon = Double.parseDouble(tokens[1]);
      factory.addPoint(lat, lon);
    }

    reader.close();

    return factory.create();
  }
View Full Code Here

  private ShapePoints readShapePoints(String path) throws IOException {

    BufferedReader reader = new BufferedReader(new FileReader(path));

    String line = null;
    ShapePointsFactory factory = new ShapePointsFactory();

    while ((line = reader.readLine()) != null) {
      String[] tokens = line.split(" ");
      double lat = Double.parseDouble(tokens[0]);
      double lon = Double.parseDouble(tokens[1]);
      factory.addPoint(lat, lon);
    }

    reader.close();

    return factory.create();
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.model.ShapePointsFactory

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.