Package ucar.nc2.dt.ugrid.geom
Class LatLonRectangle2D
java.lang.Object
ucar.nc2.dt.ugrid.geom.LatLonRectangle2D
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLatLonRectangle2D(double leftY, double leftX, double rightY, double rightX) LatLonRectangle2D(Point2D leftPoint, Point2D rightPoint) LatLonRectangle2D(LatLonPoint2D leftPoint, double dLat, double dLon) Deprecated.LatLonRectangle2D(LatLonPoint2D leftPoint, LatLonPoint2D rightPoint) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainedBy(LatLonRectangle2D rect) booleancontains(double lat, double lon) booleanbooleancontains(LatLonPoint2D point) booleancontains(LatLonPolygon2D poly) booleancontains(LatLonRectangle2D rect) copy()Creates and returns a copy of this LatLonRectangle2Dbooleanbooleanequals(LatLonRectangle2D rect) voidextend(double[] bounds) Extends the bounds of thisLatLonRectangle2Dby the coordinates in the bounding rectangle given bybounds.voidextend(double pLat, double pLon) voidextend(LatLonPoint2D point) voidextend(LatLonPolygon2D poly) voidextend(LatLonRectangle2D rect) doublegetArea()double[]Returns the coordinates of thisLatLonRectangle2Das adoublearray with a length of 4.doubledoubledoubledouble[]doubledoubledouble[]doubledoubledoublegetWidth()booleanintersects(LatLonPoint2D point) booleanintersects(LatLonPolygon2D poly) booleanintersects(LatLonRectangle2D rect) recenter(double centerLat, double centerLon) Usestranslate(double, double)to shift this LatLonRectangle2D so that the centroid matches the location specified by centerLat and centerLon.Usestranslate(double, double)to shift this LatLonRectangle2D so that the centroid matches newCenterPoint.recenter(LatLonRectangle2D referenceRectangle) Usestranslate(double, double)to shift this LatLonRectangle2D so that the centroid matches the centroid of the referenceRectangle.booleanucar.unidata.geoloc.LatLonRecttoString()translate(double deltaLat, double deltaLon) Shifts this rectangle by the distances deltaLat and deltaLon.
-
Constructor Details
-
LatLonRectangle2D
Deprecated. -
LatLonRectangle2D
public LatLonRectangle2D(double leftY, double leftX, double rightY, double rightX) -
LatLonRectangle2D
-
LatLonRectangle2D
-
LatLonRectangle2D
-
-
Method Details
-
getBoundingLatLonValues
public double[] getBoundingLatLonValues()Returns the coordinates of thisLatLonRectangle2Das adoublearray 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 ofdouble[] {lly, llx, ury, urx}.- Returns:
- a
doublearray with a length of 4 containing the lat/lon points of this rectangle. If this object contains no verticesnullis returned.
-
getLowerLeftPoint
-
getUpperRightPoint
-
getLowerRightPoint
-
getUpperLeftPoint
-
crossesDateline
public boolean crossesDateline() -
equals
-
getWidth
public double getWidth() -
getHeight
public double getHeight() -
getCenterLatitude
public double getCenterLatitude() -
getCenterLongitude
public double getCenterLongitude() -
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
-
contains
-
contains
public boolean contains(double lat, double lon) -
contains
-
contains
-
containedBy
-
intersects
-
intersects
-
intersects
-
extend
public void extend(double pLat, double pLon) -
extend
-
extend
public void extend(double[] bounds) Extends the bounds of thisLatLonRectangle2Dby the coordinates in the bounding rectangle given bybounds. 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
-
extend
-
shouldCrossDateline
-
getArea
public double getArea() -
copy
Creates and returns a copy of this LatLonRectangle2D- Returns:
- a copy of this LatLonRectangle2D
-
translate
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
Usestranslate(double, double)to shift this LatLonRectangle2D so that the centroid matches the centroid of the referenceRectangle. Delegates torecenter(Point2D)- Parameters:
referenceRectangle- the LatLonRectangle2D to move this LatLonRectangle2D's centroid to- Returns:
- this LatLonRectangle2D, for convenience
-
recenter
Usestranslate(double, double)to shift this LatLonRectangle2D so that the centroid matches newCenterPoint. Delegates torecenter(double, double)- Parameters:
newCenterPoint- the new center point- Returns:
- this LatLonRectangle2D, for convenience
-
recenter
Usestranslate(double, double)to shift this LatLonRectangle2D so that the centroid matches the location specified by centerLat and centerLon.- Parameters:
centerLat- the new center latitudecenterLon- the new center longitude- Returns:
- this LatLonRectangle2D, for convenience
-
toString
-
toLatLonRect
public ucar.unidata.geoloc.LatLonRect toLatLonRect()
-