Examples of CoordinateBounds


Examples of org.onebusaway.geospatial.model.CoordinateBounds

    SimpleFederatedService serviceA = Mockito.mock(SimpleFederatedService.class);

    Map<String, List<CoordinateBounds>> firstProviderAgenciesAndCoverage = new HashMap<String, List<CoordinateBounds>>();
    firstProviderAgenciesAndCoverage.put("a1", Arrays.asList(
        new CoordinateBounds(1, 1, 3, 3), new CoordinateBounds(2, 2, 4, 4)));
    firstProviderAgenciesAndCoverage.put("a2",
        Arrays.asList(new CoordinateBounds(2, 5, 4, 6)));
    providers.put(serviceA, firstProviderAgenciesAndCoverage);

    SimpleFederatedService serviceB = Mockito.mock(SimpleFederatedService.class);

    Map<String, List<CoordinateBounds>> secondProviderAgenciesAndCoverage = new HashMap<String, List<CoordinateBounds>>();
    secondProviderAgenciesAndCoverage.put("b1", Arrays.asList(
        new CoordinateBounds(5, 5, 7, 7), new CoordinateBounds(6, 6, 8, 8)));
    secondProviderAgenciesAndCoverage.put("b2",
        Arrays.asList(new CoordinateBounds(5, 2, 7, 4)));
    providers.put(serviceB, secondProviderAgenciesAndCoverage);

    FederatedServiceCollection registry = new FederatedServiceCollectionImpl(
        providers);
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

    return hubStops;
  }

  private Map<StopEntry, Integer> getNearbyStopsAndWalkTimes(StopEntry stop) {

    CoordinateBounds bounds = SphericalGeometryLibrary.bounds(
        stop.getStopLocation(), _nearbyStopsRadius);

    Map<StopEntry, Integer> nearbyStopsAndWalkTimes = new HashMap<StopEntry, Integer>();

    OBATraverseOptions opts = _otpConfigurationService.createTraverseOptions();
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

public class CoordinateBoundsTest {

  @Test
  public void testCoordinateBounds() {
    CoordinateBounds bounds = new CoordinateBounds();
    assertTrue(bounds.isEmpty());

    bounds.addPoint(1, 2);
    assertFalse(bounds.isEmpty());
    assertEquals(1, bounds.getMinLat(), 0);
    assertEquals(2, bounds.getMinLon(), 0);
    assertEquals(1, bounds.getMaxLat(), 0);
    assertEquals(2, bounds.getMaxLon(), 0);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

    assertEquals(2, bounds.getMaxLon(), 0);
  }

  @Test
  public void testCoordinateBoundsDoubleDouble() {
    CoordinateBounds bounds = new CoordinateBounds(1, 2);
    assertFalse(bounds.isEmpty());
    assertEquals(1, bounds.getMinLat(), 0);
    assertEquals(2, bounds.getMinLon(), 0);
    assertEquals(1, bounds.getMaxLat(), 0);
    assertEquals(2, bounds.getMaxLon(), 0);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

    assertEquals(2, bounds.getMaxLon(), 0);
  }

  @Test
  public void testCoordinateBoundsCoordinateBounds() {
    CoordinateBounds bounds = new CoordinateBounds(1, 2);
    bounds = new CoordinateBounds(bounds);
    assertFalse(bounds.isEmpty());
    assertEquals(1, bounds.getMinLat(), 0);
    assertEquals(2, bounds.getMinLon(), 0);
    assertEquals(1, bounds.getMaxLat(), 0);
    assertEquals(2, bounds.getMaxLon(), 0);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

    assertEquals(2, bounds.getMaxLon(), 0);
  }

  @Test
  public void testCoordinateBoundsDoubleDoubleDoubleDouble() {
    CoordinateBounds bounds = new CoordinateBounds(1, 2,0,5);
    assertFalse(bounds.isEmpty());
    assertEquals(0, bounds.getMinLat(), 0);
    assertEquals(2, bounds.getMinLon(), 0);
    assertEquals(1, bounds.getMaxLat(), 0);
    assertEquals(5, bounds.getMaxLon(), 0);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

    assertEquals(5, bounds.getMaxLon(), 0);
  }

  @Test
  public void testSetEmpty() {
    CoordinateBounds bounds = new CoordinateBounds(1,2);
    assertFalse(bounds.isEmpty());
    bounds.setEmpty(true);
    assertTrue(bounds.isEmpty());
    bounds.addPoint(3, 4);
    assertFalse(bounds.isEmpty());
    assertEquals(3, bounds.getMinLat(), 0);
    assertEquals(4, bounds.getMinLon(), 0);
    assertEquals(3, bounds.getMaxLat(), 0);
    assertEquals(4, bounds.getMaxLon(), 0);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

  }

  @Test
  public void testBounds() {

    CoordinateBounds bounds = SphericalGeometryLibrary.bounds(
        47.97527158291236, -122.3527193069458, 400);

    double d1 = SphericalGeometryLibrary.distance(bounds.getMaxLat(),
        bounds.getMaxLon(), bounds.getMinLat(), bounds.getMaxLon());
    assertEquals(800, d1, 0.01);

    double d2 = SphericalGeometryLibrary.distance(bounds.getMaxLat(),
        bounds.getMinLon(), bounds.getMinLat(), bounds.getMinLon());
    assertEquals(800, d2, 0.01);

    double d3 = SphericalGeometryLibrary.distance(bounds.getMinLat(),
        bounds.getMaxLon(), bounds.getMinLat(), bounds.getMinLon());
    assertEquals(800, d3, 0.1);

    double d4 = SphericalGeometryLibrary.distance(bounds.getMaxLat(),
        bounds.getMaxLon(), bounds.getMaxLat(), bounds.getMinLon());
    assertEquals(800, d4, 0.1);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

    assertEquals(4, bounds.getMaxLon(), 0);
  }

  @Test
  public void testGetSet() {
    CoordinateBounds bounds = new CoordinateBounds(1,2);
    bounds.setMinLat(3);
    bounds.setMinLon(4);
    bounds.setMaxLat(5);
    bounds.setMaxLon(6);
    assertEquals(3, bounds.getMinLat(), 0);
    assertEquals(4, bounds.getMinLon(), 0);
    assertEquals(5, bounds.getMaxLat(), 0);
    assertEquals(6, bounds.getMaxLon(), 0);
  }
View Full Code Here

Examples of org.onebusaway.geospatial.model.CoordinateBounds

    assertEquals(6, bounds.getMaxLon(), 0);
  }

  @Test
  public void testAddPoint() {
    CoordinateBounds bounds = new CoordinateBounds();
    bounds.addPoint(1,2);
    assertEquals(1, bounds.getMinLat(), 0);
    assertEquals(2, bounds.getMinLon(), 0);
    assertEquals(1, bounds.getMaxLat(), 0);
    assertEquals(2, bounds.getMaxLon(), 0);
    bounds.addPoint(0,5);
    assertEquals(0, bounds.getMinLat(), 0);
    assertEquals(2, bounds.getMinLon(), 0);
    assertEquals(1, bounds.getMaxLat(), 0);
    assertEquals(5, bounds.getMaxLon(), 0);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.