Package com.motomapia.util

Examples of com.motomapia.util.GeoDelta


   * @param count is a limit; you might get less than this
   * @return an unsorted list, or an empty list if something went wrong.
   */
  public static List<WikiPlace> box(GeoPt sw, GeoPt ne, int count)
  {
    GeoDelta delta = new GeoDelta(ne.getLatitude() - sw.getLatitude(), ne.getLongitude() - sw.getLongitude());
    GeoPt center = new GeoPt(sw.getLatitude() + delta.getLatitude() / 2, sw.getLongitude() + delta.getLongitude() / 2);

    return box(center, delta, count);
  }
View Full Code Here


    final float minDelta = 0.00122f;
    final float maxCombo = 1464.1f;
    final float sqrtMaxCombo = 38.26355968803739f;

    if (delta.getLatitude() < minDelta || delta.getLongitude() < minDelta)
      return new GeoDelta(minDelta, minDelta);

    float combo = delta.getLatitude() * delta.getLongitude() * 10000000;
    if (combo > maxCombo)
    {
      float lat = delta.getLatitude();
      float lng = delta.getLongitude();

      if (lat > sqrtMaxCombo)
        lat = sqrtMaxCombo;

      if (lng > sqrtMaxCombo)
        lng = sqrtMaxCombo;

      return new GeoDelta(lat, lng);
    }

    return delta;
  }
View Full Code Here

TOP

Related Classes of com.motomapia.util.GeoDelta

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.