|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.data.Bounds
public class Bounds
This is a simple data class for "rectangular" areas of the world, given in lat/lon min/max values. The values are rounded to LatLon.OSM_SERVER_PRECISION
Nested Class Summary | |
---|---|
static class |
Bounds.ParseMethod
|
Field Summary | |
---|---|
private double |
maxLat
The minimum and maximum coordinates. |
private double |
maxLon
The minimum and maximum coordinates. |
private double |
minLat
The minimum and maximum coordinates. |
private double |
minLon
The minimum and maximum coordinates. |
Constructor Summary | |
---|---|
Bounds(Bounds other)
|
|
Bounds(double[] coords)
|
|
Bounds(double[] coords,
boolean roundToOsmPrecision)
|
|
Bounds(double minlat,
double minlon,
double maxlat,
double maxlon)
|
|
Bounds(double minlat,
double minlon,
double maxlat,
double maxlon,
boolean roundToOsmPrecision)
|
|
Bounds(LatLon b)
|
|
Bounds(LatLon b,
boolean roundToOsmPrecision)
|
|
Bounds(LatLon center,
double latExtent,
double lonExtent)
Creates new bounds around a coordinate pair center . |
|
Bounds(LatLon min,
LatLon max)
Construct bounds out of two points |
|
Bounds(LatLon min,
LatLon max,
boolean roundToOsmPrecision)
|
|
Bounds(java.awt.geom.Rectangle2D rect)
|
|
Bounds(java.lang.String asString,
java.lang.String separator)
|
|
Bounds(java.lang.String asString,
java.lang.String separator,
Bounds.ParseMethod parseMethod)
|
|
Bounds(java.lang.String asString,
java.lang.String separator,
Bounds.ParseMethod parseMethod,
boolean roundToOsmPrecision)
|
Method Summary | |
---|---|
java.awt.geom.Rectangle2D.Double |
asRect()
Converts the lat/lon bounding box to an object of type Rectangle2D.Double |
boolean |
contains(LatLon ll)
Is the given point within this bounds? |
boolean |
crosses180thMeridian()
Determines if this Bounds object crosses the 180th Meridian. |
java.lang.String |
encodeAsString(java.lang.String separator)
|
boolean |
equals(java.lang.Object obj)
|
void |
extend(Bounds b)
|
void |
extend(LatLon ll)
Extend the bounds if necessary to include the given point. |
double |
getArea()
|
LatLon |
getCenter()
|
LatLon |
getMax()
|
LatLon |
getMin()
|
int |
hashCode()
|
protected static double |
initLat(double value,
boolean roundToOsmPrecision)
|
protected static double |
initLon(double value,
boolean roundToOsmPrecision)
|
boolean |
intersects(Bounds b)
The two bounds intersect? Compared to java Shape.intersects, if does not use the interior but the closure. |
private static boolean |
intersectsLonCrossing(Bounds crossing,
Bounds notCrossing)
|
boolean |
isCollapsed()
Replies true, if this bounds are collapsed, i.e. |
boolean |
isOutOfTheWorld()
|
void |
normalize()
|
java.lang.String |
toShortString(java.text.DecimalFormat format)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double minLat
private double minLon
private double maxLat
private double maxLon
Constructor Detail |
---|
public Bounds(LatLon min, LatLon max)
public Bounds(LatLon min, LatLon max, boolean roundToOsmPrecision)
public Bounds(LatLon b)
public Bounds(LatLon b, boolean roundToOsmPrecision)
public Bounds(double minlat, double minlon, double maxlat, double maxlon)
public Bounds(double minlat, double minlon, double maxlat, double maxlon, boolean roundToOsmPrecision)
public Bounds(double[] coords)
public Bounds(double[] coords, boolean roundToOsmPrecision)
public Bounds(java.lang.String asString, java.lang.String separator) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Bounds(java.lang.String asString, java.lang.String separator, Bounds.ParseMethod parseMethod) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Bounds(java.lang.String asString, java.lang.String separator, Bounds.ParseMethod parseMethod, boolean roundToOsmPrecision) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Bounds(Bounds other)
public Bounds(java.awt.geom.Rectangle2D rect)
public Bounds(LatLon center, double latExtent, double lonExtent)
center
. The
new bounds shall have an extension in latitude direction of latExtent
,
and in longitude direction of lonExtent
.
center
- the center coordinate pair. Must not be null.latExtent
- the latitude extent. > 0 required.lonExtent
- the longitude extent. > 0 required.
java.lang.IllegalArgumentException
- thrown if center is null
java.lang.IllegalArgumentException
- thrown if latExtent <= 0
java.lang.IllegalArgumentException
- thrown if lonExtent <= 0Method Detail |
---|
public LatLon getMin()
public LatLon getMax()
protected static double initLat(double value, boolean roundToOsmPrecision)
protected static double initLon(double value, boolean roundToOsmPrecision)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toShortString(java.text.DecimalFormat format)
public LatLon getCenter()
public void extend(LatLon ll)
public void extend(Bounds b)
public boolean contains(LatLon ll)
private static boolean intersectsLonCrossing(Bounds crossing, Bounds notCrossing)
public boolean intersects(Bounds b)
public boolean crosses180thMeridian()
public java.awt.geom.Rectangle2D.Double asRect()
public double getArea()
public java.lang.String encodeAsString(java.lang.String separator)
public boolean isCollapsed()
Replies true, if this bounds are collapsed, i.e. if the min and the max corner are equal.
public boolean isOutOfTheWorld()
public void normalize()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |