Package org.onebusaway.transit_data_federation.model

Examples of org.onebusaway.transit_data_federation.model.ShapePointsFactory


    tripB.setShapeId(shapeIdB);

    Mockito.when(transitGraphDao.getAllTrips()).thenReturn(
        Arrays.asList((TripEntry) tripA, tripB));

    ShapePointsFactory factory = new ShapePointsFactory();
    factory.addPoint(47.652300128129454, -122.30622018270873);
    factory.addPoint(47.653181844549394, -122.30523312979125);
    factory.addPoint(47.654265901710744, -122.30511511259459);
    ShapePoints shapeA = factory.create();

    factory = new ShapePointsFactory();
    factory.addPoint(47.661275594717026, -122.31189573698424);
    factory.addPoint(47.661347854692465, -122.3240622370758);
    factory.addPoint(47.661368177792546, -122.32508885257624);
    factory.addPoint(47.66496659665593, -122.32501375072383);
    ShapePoints shapeB = factory.create();

    Mockito.when(shapePointHelper.getShapePointsForShapeId(shapeIdA)).thenReturn(
        shapeA);
    Mockito.when(shapePointHelper.getShapePointsForShapeId(shapeIdB)).thenReturn(
        shapeB);
View Full Code Here


    Stop stop = new Stop();
    stop.setId(stopEntry.getId());
    Mockito.when(_gtfsDao.getAllStops()).thenReturn(Arrays.asList(stop));

    AgencyAndId shapeId = aid("shapeA");
    ShapePointsFactory factory = new ShapePointsFactory();
    factory.addPoint(47.661225, -122.3009201);
    factory.addPoint(47.664375, -122.3008986);
    ShapePoints shapePoints = factory.create();

    _provider.setShapePointsForId(shapeId, shapePoints);

    TripEntryImpl trip = trip("trip");
    trip.setShapeId(shapeId);
View Full Code Here

    /**
     * Two shapes heading in opposite directions
     */
    AgencyAndId shapeIdA = aid("shapeA");
    ShapePointsFactory factoryA = new ShapePointsFactory();
    factoryA.addPoint(47.661225, -122.3009201);
    factoryA.addPoint(47.664375, -122.3008986);
    ShapePoints shapePointsA = factoryA.create();
    _provider.setShapePointsForId(shapeIdA, shapePointsA);

    AgencyAndId shapeIdB = aid("shapeB");
    ShapePointsFactory factoryB = new ShapePointsFactory();
    factoryB.addPoint(47.664375, -122.3008986);
    factoryB.addPoint(47.661225, -122.3009201);
    ShapePoints shapePointsB = factoryB.create();
    _provider.setShapePointsForId(shapeIdB, shapePointsB);

    TripEntryImpl tripA = trip("tripA");
    tripA.setShapeId(shapeIdA);

View Full Code Here

    TripEntryImpl tripB = trip("B", "serviceId", 1000.0);

    tripA.setShapeId(aid("shapeA"));
    tripB.setShapeId(aid("shapeB"));

    ShapePointsFactory m = new ShapePointsFactory();
    m.setShapeId(aid("shapeA"));
    m.addPoint(47.670170374084805, -122.3875880241394);
    m.addPoint(47.66871094987642, -122.38756656646729);
    m.addPoint(47.66862425012441, -122.38610744476318);
    m.addPoint(47.66869649992775, -122.38439083099365);
    m.addPoint(47.664852671516094, -122.3800778388977);
    m.addPoint(47.664467962697906, -122.37945087847474);

    Mockito.when(_shapePointService.getShapePointsForShapeId(aid("shapeA"))).thenReturn(
        m.create());

    m = new ShapePointsFactory();
    m.setShapeId(aid("shapeB"));
    m.addPoint(47.664467962697906, -122.37945087847474);
    m.addPoint(47.663667674849385, -122.37814664840698);
    m.addPoint(47.663667674849385, -122.37355470657349);

    Mockito.when(_shapePointService.getShapePointsForShapeId(aid("shapeB"))).thenReturn(
        m.create());

    _stopA = stop("stopA", 47.66868114116101, -122.3870648978625);
    _stopB = stop("stopB", 47.66583195331816, -122.38117664826683);
    _stopC = stop("stopC", 47.663667674849385, -122.37724035677341);
View Full Code Here

    RouteEntryImpl routeEntry = route("routeA");
    graph.putRouteEntry(routeEntry);

    graph.initialize();

    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

  }

  @Test
  public void test04() {

    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();
View Full Code Here

     * ShapePointsService
     ****/

    ShapePointHelper shapePointService = Mockito.mock(ShapePointHelper.class);

    ShapePointsFactory shapePointsFactory = new ShapePointsFactory();
    shapePointsFactory.addPoint(0, 0);

    Mockito.when(
        shapePointService.getShapePointsForShapeId((AgencyAndId) Mockito.any())).thenReturn(
        shapePointsFactory.create());

    /****
     * Factory
     ****/

 
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

    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

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

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

    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

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.