|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.agmodel.physical.GeographicalBox
A 2-dimensional space using latitude, and longitude.
| Field Summary | |
static GeographicalBox |
EVERYWHERE
|
static GeographicalBox |
UNKNOWN
|
| Fields inherited from interface net.agmodel.physical.GeographicalArea |
EVEREST, METRESPERDEGREEOFLATITUDE, METRESPERDEGREEOFLONGATEQUATOR, METRESPERPIXEL |
| Constructor Summary | |
GeographicalBox(Location2D northWestBound,
Location2D southEastBound)
|
|
| Method Summary | |
int |
compareTo(Object another)
Lets GeographicalBoxes be sorted based on their northwest corners |
boolean |
contains(Location2D point)
Indicate whether a point is within the area |
boolean |
equals(Object o)
Tests whether two objects represent the same GeographicalBox. |
GeographicalBox |
getBoundingBox()
Return a box which bounds the area. |
Location2D |
getCenter()
|
double |
getDistanceEW()
Returns the length of an East-West arc between the eastern and western boundaries of the box running through the center of the box. |
double |
getDistanceNS()
Returns the length of a North-South arc between the northern and southern boundaries of the box. |
double |
getLatitudeRange()
Returns the difference in latitude between the northern and southern extremes (always positive) |
double |
getLongitudeRange()
Returns the difference in longitude between the eastern and western extremes (always positive) |
Location2D |
getNorthWestBound()
|
double |
getRelativeLat(double latitude)
Returns the latitude of a location relative to the box. |
double |
getRelativeLong(double longitude)
Returns the longitude of a location relative to the box. |
Location2D |
getSouthEastBound()
|
int |
hashCode()
|
boolean |
isUnknown()
Indicates whether the bounds of this area are unknown. |
static double |
metresPerDegreeOfLongitude(double latitude)
|
boolean |
overlapsWith(GeographicalArea area)
Indicate whether the supplied area overlaps with this area. |
boolean |
spansDateline()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final GeographicalBox EVERYWHERE
public static final GeographicalBox UNKNOWN
| Constructor Detail |
public GeographicalBox(Location2D northWestBound,
Location2D southEastBound)
| Method Detail |
public static double metresPerDegreeOfLongitude(double latitude)
public GeographicalBox getBoundingBox()
GeographicalAreaoverlapsWith
for arbitrary shapes.
If isUnknown() returns true for the area, then returns GeographicalBox.UNKNOWN
getBoundingBox in interface GeographicalAreapublic String toString()
toString in class Objectpublic boolean contains(Location2D point)
GeographicalArea
contains in interface GeographicalAreapoint - the point of interest
public boolean overlapsWith(GeographicalArea area)
GeographicalAreagetBoundingBox for a way of approximately
implementing this for arbitrary shapes. Suggestions for improvement welcome.
If isUnknown() returns true for either or both areas, the result is false;
overlapsWith in interface GeographicalAreaarea - the area of interestpublic int compareTo(Object another)
compareTo in interface Comparablepublic Location2D getNorthWestBound()
public Location2D getSouthEastBound()
public double getLatitudeRange()
public double getLongitudeRange()
public Location2D getCenter()
public boolean spansDateline()
public double getRelativeLat(double latitude)
latitude -
public double getRelativeLong(double longitude)
longitude -
public double getDistanceNS()
public double getDistanceEW()
public boolean isUnknown()
GeographicalArea
isUnknown in interface GeographicalAreapublic boolean equals(Object o)
equals in class Objecto - the other object
public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||