|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.unidata.geoloc.LatLonRect
public class LatLonRect
Bounding box for latitude/longitude points. This is a rectangle in lat/lon coordinates. This class handles the longitude wrapping problem. Note that LatLonPoint always has lon in the range +/-180.
Constructor Summary | |
---|---|
LatLonRect()
Create a LatLonRect that covers the whole world. |
|
LatLonRect(LatLonPoint p1,
double deltaLat,
double deltaLon)
Construct a lat/lon bounding box from a point, and a delta lat, lon. |
|
LatLonRect(LatLonPoint left,
LatLonPoint right)
Construct a lat/lon bounding box from two points. |
|
LatLonRect(LatLonRect r)
Copy Constructor |
|
LatLonRect(java.lang.String spec)
Construct a lat/lon bounding box from a string. |
Method Summary | |
---|---|
boolean |
containedIn(LatLonRect b)
Determine if this bounding box is contained in another LatLonRect. |
boolean |
contains(double lat,
double lon)
Determine if the given lat/lon point is contined inside this rectangle. |
boolean |
contains(LatLonPoint p)
Determine if a specified LatLonPoint is contained in this bounding box. |
boolean |
crossDateline()
Get whether the bounding box crosses the +/- 180 seam |
boolean |
equals(LatLonRect other)
get whether two bounding boxes are equal in values |
void |
extend(LatLonPoint p)
Extend the bounding box to contain this point |
void |
extend(LatLonRect r)
Extend the bounding box to contain the given rectangle |
double |
getCenterLon()
return center Longitude, always in the range +/-180 |
double |
getHeight()
return height of bounding box, always between 0 and 180 degrees. |
double |
getLatMax()
Get maximum latitude, aka "north" edge |
double |
getLatMin()
Get minimum latitude, aka "south" edge |
double |
getLonMax()
Get maximum longitude, aka "east" edge |
double |
getLonMin()
Get minimum longitude, aka "west" edge |
LatLonPointImpl |
getLowerLeftPoint()
Get the lower left corner of the bounding box. |
LatLonPointImpl |
getLowerRightPoint()
Get the lower left corner of the bounding box. |
LatLonPointImpl |
getUpperLeftPoint()
Get the upper left corner of the bounding box. |
LatLonPointImpl |
getUpperRightPoint()
Get the upper right corner of the bounding box. |
double |
getWidth()
return width of bounding box, always between 0 and 360 degrees. |
LatLonRect |
intersect(LatLonRect clip)
Create the instersection of this LatLon with the given one |
java.lang.String |
toString()
Return a String representation of this object. |
java.lang.String |
toString2()
Return a String representation of this object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LatLonRect(LatLonPoint p1, double deltaLat, double deltaLon)
p1
- one corner of the boxdeltaLat
- delta lat from p1. (may be positive or negetive)deltaLon
- delta lon from p1. (may be positive or negetive)public LatLonRect(LatLonPoint left, LatLonPoint right)
left
- left cornerright
- right cornerpublic LatLonRect(java.lang.String spec)
spec
- "lat, lon, deltaLat, deltaLon"LatLonRect(LatLonPoint p1, double deltaLat, double deltaLon)
public LatLonRect(LatLonRect r)
r
- rectangle to copypublic LatLonRect()
Method Detail |
---|
public LatLonPointImpl getUpperRightPoint()
public LatLonPointImpl getLowerLeftPoint()
public LatLonPointImpl getUpperLeftPoint()
public LatLonPointImpl getLowerRightPoint()
public boolean crossDateline()
public boolean equals(LatLonRect other)
other
- other bounding box
public double getWidth()
public double getHeight()
public double getCenterLon()
public double getLonMin()
public double getLonMax()
public double getLatMin()
public double getLatMax()
public boolean contains(LatLonPoint p)
p
- the specified point to be tested
public boolean contains(double lat, double lon)
lat
- lat of pointlon
- lon of point
public boolean containedIn(LatLonRect b)
b
- the other box to see if it contains this one
public void extend(LatLonPoint p)
p
- point to includepublic void extend(LatLonRect r)
r
- rectangle to includepublic LatLonRect intersect(LatLonRect clip)
clip
- intersect with this
public java.lang.String toString()
eg: ll: 90.0S .0E+ ur: 90.0N .0E
toString
in class java.lang.Object
public java.lang.String toString2()
lat= [-90.00,90.00] lon= [0.00,360.00
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |