Package org.openstreetmap.josm.data
Interface IBounds
-
- All Known Implementing Classes:
BBox,BBox.Immutable,Bounds,ImageryInfo.ImageryBounds,QuadBuckets.QBLevel,SourceBounds
public interface IBounds
Represents a "rectangular" area of the world, given in lat/lon min/max values.- Since:
- 17703
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancontains(ILatLon ll)Determines if the given pointllis within these bounds.default booleancontains(IBounds b)Tests, whether the bboxblies completely inside this bbox.default booleancrosses180thMeridian()Determines if this Bounds object crosses the 180th Meridian.default doublegetArea()Gets the area of this bounds (in lat/lon space)ILatLongetCenter()Returns center of the bounding box.doublegetHeight()Returns the bounds width.default ILatLongetMax()Gets the point that has both the maximum lat and lon coordinatedoublegetMaxLat()Returns max latitude of bounds.doublegetMaxLon()Returns max longitude of bounds.default ILatLongetMin()Gets the point that has both the minimal lat and lon coordinatedoublegetMinLat()Returns min latitude of bounds.doublegetMinLon()Returns min longitude of bounds.doublegetWidth()Returns the bounds width.default booleanintersects(IBounds b)The two bounds intersect? Compared to java Shape.intersects, if does not use the interior but the closure.default booleanisValid()Determines if the bbox covers a part of the planet surface.
-
-
-
Method Detail
-
getMin
default ILatLon getMin()
Gets the point that has both the minimal lat and lon coordinate- Returns:
- The point
-
getMinLat
double getMinLat()
Returns min latitude of bounds. Efficient shortcut forgetMin().lat().- Returns:
- min latitude of bounds.
-
getMinLon
double getMinLon()
Returns min longitude of bounds. Efficient shortcut forgetMin().lon().- Returns:
- min longitude of bounds.
-
getMax
default ILatLon getMax()
Gets the point that has both the maximum lat and lon coordinate- Returns:
- The point
-
getMaxLat
double getMaxLat()
Returns max latitude of bounds. Efficient shortcut forgetMax().lat().- Returns:
- max latitude of bounds.
-
getMaxLon
double getMaxLon()
Returns max longitude of bounds. Efficient shortcut forgetMax().lon().- Returns:
- max longitude of bounds.
-
getCenter
ILatLon getCenter()
Returns center of the bounding box.- Returns:
- Center of the bounding box.
-
contains
default boolean contains(ILatLon ll)
Determines if the given pointllis within these bounds.Points with unknown coordinates are always outside the coordinates.
- Parameters:
ll- The lat/lon to check- Returns:
trueifllis within these bounds,falseotherwise
-
contains
default boolean contains(IBounds b)
Tests, whether the bboxblies completely inside this bbox.- Parameters:
b- bounding box- Returns:
trueifblies completely inside this bbox
-
intersects
default boolean intersects(IBounds b)
The two bounds intersect? Compared to java Shape.intersects, if does not use the interior but the closure. (">=" instead of ">")- Parameters:
b- other bounds- Returns:
trueif the two bounds intersect
-
getHeight
double getHeight()
Returns the bounds width.- Returns:
- the bounds width
-
getWidth
double getWidth()
Returns the bounds width.- Returns:
- the bounds width
-
getArea
default double getArea()
Gets the area of this bounds (in lat/lon space)- Returns:
- The area
-
isValid
default boolean isValid()
Determines if the bbox covers a part of the planet surface.- Returns:
- true if the bbox covers a part of the planet surface. Height and width must be non-negative, but may (both) be 0.
-
crosses180thMeridian
default boolean crosses180thMeridian()
Determines if this Bounds object crosses the 180th Meridian. See http://wiki.openstreetmap.org/wiki/180th_meridian- Returns:
- true if this Bounds object crosses the 180th Meridian.
-
-