Class LatLonRectangle2D

java.lang.Object
ucar.nc2.dt.ugrid.geom.LatLonRectangle2D
All Implemented Interfaces:
Serializable

public class LatLonRectangle2D extends Object implements Serializable
See Also:
  • Constructor Details

    • LatLonRectangle2D

      @Deprecated public LatLonRectangle2D(LatLonPoint2D leftPoint, double dLat, double dLon)
      Deprecated.
    • LatLonRectangle2D

      public LatLonRectangle2D(double leftY, double leftX, double rightY, double rightX)
    • LatLonRectangle2D

      public LatLonRectangle2D(LatLonPoint2D leftPoint, LatLonPoint2D rightPoint)
    • LatLonRectangle2D

      public LatLonRectangle2D(Point2D leftPoint, Point2D rightPoint)
    • LatLonRectangle2D

      public LatLonRectangle2D(LatLonRectangle2D rect)
  • Method Details

    • getBoundingLatLonValues

      public double[] getBoundingLatLonValues()
      Returns the coordinates of this LatLonRectangle2D as a double array with a length of 4. The coordinates are arranged in the order of southern lat, western lon, northern lat, and eastern lon

      In terms of points where LL = lower left and UR = upper right, this is equivalent to the arrangement of double[] {lly, llx, ury, urx}.
      Returns:
      a double array with a length of 4 containing the lat/lon points of this rectangle. If this object contains no vertices null is returned.
    • getLowerLeftPoint

      public LatLonPoint2D getLowerLeftPoint()
    • getUpperRightPoint

      public LatLonPoint2D getUpperRightPoint()
    • getLowerRightPoint

      public LatLonPoint2D getLowerRightPoint()
    • getUpperLeftPoint

      public LatLonPoint2D getUpperLeftPoint()
    • crossesDateline

      public boolean crossesDateline()
    • equals

      public boolean equals(LatLonRectangle2D rect)
    • getWidth

      public double getWidth()
    • getHeight

      public double getHeight()
    • getCenterLatitude

      public double getCenterLatitude()
    • getCenterLongitude

      public double getCenterLongitude()
    • getCentroid

      public LatLonPoint2D getCentroid()
    • getLonMin

      public double getLonMin()
    • getLonMax

      public double getLonMax()
    • getLatMin

      public double getLatMin()
    • getLatMax

      public double getLatMax()
    • getLonCoords

      public double[] getLonCoords()
    • getLatCoords

      public double[] getLatCoords()
    • contains

      public boolean contains(Point2D point)
    • contains

      public boolean contains(LatLonPoint2D point)
    • contains

      public boolean contains(double lat, double lon)
    • contains

      public boolean contains(LatLonRectangle2D rect)
    • contains

      public boolean contains(LatLonPolygon2D poly)
    • containedBy

      public boolean containedBy(LatLonRectangle2D rect)
    • intersects

      public boolean intersects(LatLonRectangle2D rect)
    • intersects

      public boolean intersects(LatLonPolygon2D poly)
    • intersects

      public boolean intersects(LatLonPoint2D point)
    • extend

      public void extend(double pLat, double pLon)
    • extend

      public void extend(LatLonPoint2D point)
    • extend

      public void extend(double[] bounds)
      Extends the bounds of this LatLonRectangle2D by the coordinates in the bounding rectangle given by bounds. It is assumed that bounds is a non-null double array with a length of 4 which contains lat/lon coords in the arrangement of LLy, LLx, URy, URx.
      Parameters:
      bounds -
    • extend

      public void extend(LatLonRectangle2D rect)
    • extend

      public void extend(LatLonPolygon2D poly)
    • shouldCrossDateline

      public boolean shouldCrossDateline(LatLonPolygon2D poly)
    • getArea

      public double getArea()
    • copy

      public LatLonRectangle2D copy()
      Creates and returns a copy of this LatLonRectangle2D
      Returns:
      a copy of this LatLonRectangle2D
    • translate

      public LatLonRectangle2D translate(double deltaLat, double deltaLon)
      Shifts this rectangle by the distances deltaLat and deltaLon.
      Parameters:
      deltaLat - the distance (in Decimal Degrees) by which to move this rectangle vertically. + to the North, - to the South
      Returns:
      a reference to this LatLonRectangle2D - for convenience
    • recenter

      public LatLonRectangle2D recenter(LatLonRectangle2D referenceRectangle)
      Uses translate(double, double) to shift this LatLonRectangle2D so that the centroid matches the centroid of the referenceRectangle. Delegates to recenter(Point2D)
      Parameters:
      referenceRectangle - the LatLonRectangle2D to move this LatLonRectangle2D's centroid to
      Returns:
      this LatLonRectangle2D, for convenience
    • recenter

      public LatLonRectangle2D recenter(Point2D newCenterPoint)
      Uses translate(double, double) to shift this LatLonRectangle2D so that the centroid matches newCenterPoint. Delegates to recenter(double, double)
      Parameters:
      newCenterPoint - the new center point
      Returns:
      this LatLonRectangle2D, for convenience
    • recenter

      public LatLonRectangle2D recenter(double centerLat, double centerLon)
      Uses translate(double, double) to shift this LatLonRectangle2D so that the centroid matches the location specified by centerLat and centerLon.
      Parameters:
      centerLat - the new center latitude
      centerLon - the new center longitude
      Returns:
      this LatLonRectangle2D, for convenience
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toLatLonRect

      public ucar.unidata.geoloc.LatLonRect toLatLonRect()