Class LatLonRectangle2D

    • Constructor Detail

      • 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​(Point2D leftPoint,
                                 Point2D rightPoint)
    • Method Detail

      • 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.
      • crossesDateline

        public boolean crossesDateline()
      • getWidth

        public double getWidth()
      • getHeight

        public double getHeight()
      • getCenterLatitude

        public double getCenterLatitude()
      • getCenterLongitude

        public double getCenterLongitude()
      • 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​(double lat,
                                double lon)
      • intersects

        public boolean intersects​(LatLonPoint2D point)
      • extend

        public void extend​(double pLat,
                           double pLon)
      • 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 -
      • 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​(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
      • toLatLonRect

        public ucar.unidata.geoloc.LatLonRect toLatLonRect()