public class LatLonRect extends Object
Constructor and Description |
---|
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(String spec)
Construct a lat/lon bounding box from a string.
|
Modifier and Type | Method and Description |
---|---|
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
|
String |
toString()
Return a String representation of this object.
|
String |
toString2()
Return a String representation of this object.
|
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(String spec)
spec
- "lat, lon, deltaLat, deltaLon"LatLonRect(LatLonPoint p1, double deltaLat, double deltaLon)
public LatLonRect(LatLonRect r)
r
- rectangle to copypublic LatLonRect()
public LatLonPointImpl getUpperRightPoint()
public LatLonPointImpl getLowerLeftPoint()
public LatLonPointImpl getUpperLeftPoint()
public LatLonPointImpl getLowerRightPoint()
public boolean crossDateline()
public boolean equals(LatLonRect other)
other
- other bounding boxpublic 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 testedpublic boolean contains(double lat, double lon)
lat
- lat of pointlon
- lon of pointpublic boolean containedIn(LatLonRect b)
b
- the other box to see if it contains this onepublic void extend(LatLonPoint p)
p
- point to includepublic void extend(LatLonRect r)
r
- rectangle to includepublic LatLonRect intersect(LatLonRect clip)
clip
- intersect with thispublic String toString()
eg: ll: 90.0S .0E+ ur: 90.0N .0E
public String toString2()
lat= [-90.00,90.00] lon= [0.00,360.00
Copyright © 1999–2015 UCAR/Unidata. All rights reserved.