Package org.onebusaway.geospatial.model

Examples of org.onebusaway.geospatial.model.CoordinateBounds.addPoint()


      for( RouteCollectionEntry routeCollection : agency.getRouteCollections()) {
        for( RouteEntry route : routeCollection.getChildren() ) {
          for (TripEntry trip : route.getTrips() ) {
            for( StopTimeEntry stopTime : trip.getStopTimes() ) {
              StopEntry stop = stopTime.getStop();
              bounds.addPoint(stop.getStopLat(), stop.getStopLon());
            }
          }
        }
      }
View Full Code Here


  @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

  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

  }

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

    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

    Map<CoordinatePoint, Set<AgencyAndId>> shapeIdsByGridCellCorner = new FactoryMap<CoordinatePoint, Set<AgencyAndId>>(
        new HashSet<AgencyAndId>());

    CoordinateBounds fullBounds = new CoordinateBounds();
    for (StopEntry stop : _transitGraphDao.getAllStops())
      fullBounds.addPoint(stop.getStopLat(), stop.getStopLon());

    if (fullBounds.isEmpty()) {
      return Collections.emptyMap();
    }
View Full Code Here

    for (AgencyWithCoverageBean awc : agenciesWithCoverage) {

      if (awc.getLatSpan() <= 0 || awc.getLonSpan() <= 0)
        continue;

      bounds.addPoint(awc.getLat() + awc.getLatSpan() / 2,
          awc.getLon() + awc.getLonSpan() / 2);
      bounds.addPoint(awc.getLat() - awc.getLatSpan() / 2,
          awc.getLon() - awc.getLonSpan() / 2);
    }
View Full Code Here

      if (awc.getLatSpan() <= 0 || awc.getLonSpan() <= 0)
        continue;

      bounds.addPoint(awc.getLat() + awc.getLatSpan() / 2,
          awc.getLon() + awc.getLonSpan() / 2);
      bounds.addPoint(awc.getLat() - awc.getLatSpan() / 2,
          awc.getLon() - awc.getLonSpan() / 2);
    }

    if (bounds.isEmpty()) {
      config.put("centerLat", 0.0);
View Full Code Here

      for (AgencyWithCoverageBean bean : agenciesWithCoverage) {
        double lat = bean.getLat();
        double lon = bean.getLon();
        double latSpan = bean.getLatSpan() / 2;
        double lonSpan = bean.getLonSpan() / 2;
        bounds.addPoint(lat - latSpan, lon - lonSpan);
        bounds.addPoint(lat + latSpan, lon + lonSpan);
      }

      if (!bounds.isEmpty())
        _defaultBounds = bounds;
View Full Code Here

        double lat = bean.getLat();
        double lon = bean.getLon();
        double latSpan = bean.getLatSpan() / 2;
        double lonSpan = bean.getLonSpan() / 2;
        bounds.addPoint(lat - latSpan, lon - lonSpan);
        bounds.addPoint(lat + latSpan, lon + lonSpan);
      }

      if (!bounds.isEmpty())
        _defaultBounds = bounds;
    }
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.