public class BoundingBox extends Object
Constructor and Description |
---|
BoundingBox(Coord southWest,
Coord northEast)
Constructor with 2 coordinates for south west and north east
|
BoundingBox(Coord c,
double rLat,
double rLng)
Creates a bounding box around a coordinate with a given radius.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Coord cur)
indicates if the given coordinate is inside the counding box
|
static BoundingBox |
create(Coord[] coords)
create a smallest bounding box that contains all of the given coordinates
|
static BoundingBox |
create(Vector coords)
/**
create a smallest bounding box that contains all of the given coordinates
|
boolean |
equals(Object other)
Indicates whether some other object is "equal to" this one.
|
BoundingBox |
extend(BoundingBox other)
create a new bounding box that extends this bounding box with the given
bounding box
|
Coord |
getNorthEast()
Gets the north east coordinate
|
Coord |
getSouthWest()
Gets the /south west coordinate
|
int |
hashCode()
Returns a hash code value for the object.
|
double |
latitudeDifference() |
double |
longitudeDifference() |
boolean |
projected()
Indicates if this bounding box is isProjected
|
String |
toString()
Returns a string representation of the object.
|
public BoundingBox(Coord c, double rLat, double rLng)
c
- The coordinate at the center of the bounding box.rLat
- The latitude radius of the box (in degrees).rLng
- The longitude radius of the box (in degrees).public Coord getSouthWest()
public Coord getNorthEast()
public String toString()
public double latitudeDifference()
public double longitudeDifference()
public boolean contains(Coord cur)
cur
- coordinate to checkpublic boolean equals(Object other)
public int hashCode()
public static BoundingBox create(Coord[] coords)
coords
- given coordinates to create a wrapping bounding box.public static BoundingBox create(Vector coords)
coords
- given coordinates to create a wrapping bounding box.public BoundingBox extend(BoundingBox other)
other
- a bounding box that needs to extends the current bounding boxpublic boolean projected()