コード例 #1
0
  /**
   * Get a rectangle with floating point boundaries using the tile width, height, bounding box, and
   * the bounding box section within the outer box to build the rectangle from
   *
   * @param width
   * @param height
   * @param boundingBox
   * @param boundingBoxSection
   * @return
   */
  public static RectF getFloatRectangle(
      long width, long height, BoundingBox boundingBox, BoundingBox boundingBoxSection) {

    float left =
        TileBoundingBoxUtils.getXPixel(width, boundingBox, boundingBoxSection.getMinLongitude());
    float right =
        TileBoundingBoxUtils.getXPixel(width, boundingBox, boundingBoxSection.getMaxLongitude());
    float top =
        TileBoundingBoxUtils.getYPixel(height, boundingBox, boundingBoxSection.getMaxLatitude());
    float bottom =
        TileBoundingBoxUtils.getYPixel(height, boundingBox, boundingBoxSection.getMinLatitude());

    RectF rect = new RectF(left, top, right, bottom);

    return rect;
  }
コード例 #2
0
 /**
  * Get the longitude distance in the middle latitude
  *
  * @param boundingBox
  * @return
  */
 public static double getLongitudeDistance(BoundingBox boundingBox) {
   return getLongitudeDistance(boundingBox.getMinLongitude(), boundingBox.getMaxLongitude());
 }