Package org.onebusaway.geospatial.model

Examples of org.onebusaway.geospatial.model.CoordinateBounds


  @PostConstruct
  public void setup() {

    if (_calculateDefaultBoundsFromAgencyCoverage) {
      List<AgencyWithCoverageBean> agenciesWithCoverage = _transitDataService.getAgenciesWithCoverage();
      CoordinateBounds bounds = new CoordinateBounds();

      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


    return _stops;
  }

  public String execute() throws Exception {

    CoordinateBounds bounds = getDefaultSearchArea();
    if (bounds == null)
      return NEEDS_DEFAULT_SEARCH_LOCATION;

    if (_stopCode == null || _stopCode.length() == 0)
      return INPUT;
View Full Code Here

  private static final long serialVersionUID = 1L;

  public String execute() throws Exception {

    CoordinateBounds bounds = getDefaultSearchArea();
    if (bounds == null)
      return NEEDS_DEFAULT_SEARCH_LOCATION;
   
    return SUCCESS;
  }
View Full Code Here

  private static final long serialVersionUID = 1L;

  public String execute() throws Exception {

    CoordinateBounds bounds = getDefaultSearchArea();
    if (bounds == null)
      return NEEDS_DEFAULT_SEARCH_LOCATION;
   
    return SUCCESS;
  }
View Full Code Here

  }
 
  @Override
  public String execute() throws Exception {

    CoordinateBounds bounds = getDefaultSearchArea();
   
    if( bounds == null)
      return NEEDS_DEFAULT_SEARCH_LOCATION;
   
    if( _routeName == null || _routeName.length() == 0)
View Full Code Here

    WebappServiceAsync webapp = _service.getWebappService();
    Go go = new Go();

    Mockito.doAnswer(go).when(webapp).getStops(Mockito.<SearchQueryBean> any(),
        Mockito.<AsyncCallback<StopsBean>> any());
    CoordinateBounds bounds = new CoordinateBounds(0.04, 0.04, 0.6, 0.6);
    StopsHandler handler = new StopsHandler();

    _service.getStopsForRegion(bounds, handler);

    assertEquals(0, handler.getStops());
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
      Object[] arguments = invocation.getArguments();
      CoordinateBounds bounds = (CoordinateBounds) arguments[0];
      AsyncCallback<StopsBean> callback = (AsyncCallback<StopsBean>) arguments[2];
      StopsBean stopsBean = new StopsBean();
      stopsBean.setLimitExceeded(false);
      callback.onSuccess(stopsBean);
      return null;
View Full Code Here

  public final CoordinateBounds getBounds() {
    double lat = getCenterLat();
    double lon = getCenterLon();
    double latSpan = getSpanLat() / 2;
    double lonSpan = getSpanLon() / 2;
    return new CoordinateBounds(lat - latSpan, lon - lonSpan, lat + latSpan,
        lon + lonSpan);
  }
View Full Code Here

  public static void searchForRoute(String route) {

    switchToMapView();

    CoordinateBounds bounds = getSearchBounds(20 * 1000);

    SearchQueryBean query = new SearchQueryBean();
    query.setQuery(route);
    query.setMaxCount(10);
    query.setBounds(bounds);
View Full Code Here

    rootController.setSelectedIndex(0);
  }

  private static LatLngBounds getSearchBoundsAsLatLngBounds(double radius) {

    CoordinateBounds bounds = getSearchBounds(radius);

    LatLngBounds b = LatLngBounds.newInstance();
    b.extend(LatLng.newInstance(bounds.getMinLat(), bounds.getMinLon()));
    b.extend(LatLng.newInstance(bounds.getMaxLat(), bounds.getMaxLon()));
    return b;
  }
View Full Code Here

TOP

Related Classes of org.onebusaway.geospatial.model.CoordinateBounds

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.