Package org.onebusaway.transit_data_federation.model

Examples of org.onebusaway.transit_data_federation.model.ShapePoints


    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();

    ShapePointHelper shapePointHelper = Mockito.mock(ShapePointHelper.class);
    Mockito.when(shapePointHelper.getShapePointsForShapeId(shapeId)).thenReturn(
        shapePoints);
View Full Code Here


    ShapePointsFactory factory = new ShapePointsFactory();
    factory.addPoint(47.66851509562011, -122.29019398384474);
    factory.addPoint(47.66486634286269, -122.29014033966445);
    factory.addPoint(47.66486634286269, -122.29560131721877);
    ShapePoints shapePoints = factory.create();

    UTMProjection projection = UTMLibrary.getProjectionForPoint(
        shapePoints.getLatForIndex(0), shapePoints.getLonForIndex(0));

    ShapePointsLibrary spl = new ShapePointsLibrary();
    List<XYPoint> projectedShapePoints = spl.getProjectedShapePoints(
        shapePoints, projection);
View Full Code Here

  @Cacheable
  @Override
  public ShapePoints getShapePointsForShapeIds(List<AgencyAndId> shapeIds) {
    ShapePointsFactory factory = new ShapePointsFactory();
    for (AgencyAndId shapeId : shapeIds) {
      ShapePoints shapePoints = getShapePointsForShapeId(shapeId);
      factory.addPoints(shapePoints);
    }
    return factory.create();
  }
View Full Code Here

  @Cacheable
  @Override
  public T2<List<XYPoint>, double[]> getProjectedShapePoints(
      List<AgencyAndId> shapeIds, int utmZoneId) {

    ShapePoints shapePoints = _shapePointService.getShapePointsForShapeIds(shapeIds);

    if (shapePoints == null || shapePoints.isEmpty())
      return null;

    UTMProjection projection = new UTMProjection(utmZoneId);

    List<XYPoint> projected = _shapePointsLibrary.getProjectedShapePoints(
        shapePoints, projection);

    return Tuples.tuple(projected, shapePoints.getDistTraveled());
  }
View Full Code Here

    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

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

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

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

    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

public class DistanceAlongShapeLibraryTest {

  @Test
  public void test01() throws IOException, DistanceAlongShapeException {

    ShapePoints shapePoints = readShapePoints("shapes-01.txt");
    List<StopTimeEntryImpl> stopTimes = readStopTimes("stops-01.txt");

    DistanceAlongShapeLibrary library = new DistanceAlongShapeLibrary();
    PointAndIndex[] points = library.getDistancesAlongShape(shapePoints,
        stopTimes);
View Full Code Here

    assertEquals(618, points[69].index);
  }

  @Test
  public void test02() throws IOException, DistanceAlongShapeException {
    ShapePoints shapePoints = readShapePoints("shapes-02.txt");
    List<StopTimeEntryImpl> stopTimes = readStopTimes("stops-02.txt");

    DistanceAlongShapeLibrary library = new DistanceAlongShapeLibrary();
    PointAndIndex[] points = library.getDistancesAlongShape(shapePoints,
        stopTimes);
View Full Code Here

  }

  @Test
  public void test03() throws IOException, DistanceAlongShapeException {

    ShapePoints shapePoints = readShapePoints("shapes-03.txt");
    List<StopTimeEntryImpl> stopTimes = readStopTimes("stops-03.txt");

    DistanceAlongShapeLibrary library = new DistanceAlongShapeLibrary();
    PointAndIndex[] points = library.getDistancesAlongShape(shapePoints,
        stopTimes);
View Full Code Here

TOP

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

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.