Package org.apache.lucene.spatial3d.geom
Class LatLonBounds
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.LatLonBounds
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.DoubleleftLongitudeIf non-null, the left longitude boundprivate java.lang.DoublemaxLatitudeIf non-null, the maximum latitude boundprivate java.lang.DoubleminLatitudeIf non-null, the minimum latitude boundprivate booleannoBottomLatitudeBoundSet to true if no bottom latitude bound can be statedprivate booleannoLongitudeBoundSet to true if no longitude bounds can be statedprivate booleannoTopLatitudeBoundSet to true if no top latitude bound can be statedprivate java.lang.DoublerightLongitudeIf non-null, the right longitude bound
-
Constructor Summary
Constructors Constructor Description LatLonBounds()Construct an empty bounds object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundsaddHorizontalPlane(PlanetModel planetModel, double latitude, Plane horizontalPlane, Membership... bounds)Add a horizontal plane to the bounds description.BoundsaddIntersection(PlanetModel planetModel, Plane plane1, Plane plane2, Membership... bounds)Add the intersection between two planes to the bounds description.private voidaddLatitudeBound(double latitude)Update latitude bound.private voidaddLongitudeBound(double longitude)Update longitude bound.BoundsaddPlane(PlanetModel planetModel, Plane plane, Membership... bounds)Add a general plane to the bounds description.BoundsaddPoint(GeoPoint point)Add a single point.BoundsaddVerticalPlane(PlanetModel planetModel, double longitude, Plane verticalPlane, Membership... bounds)Add a vertical plane to the bounds description.BoundsaddXValue(GeoPoint point)Add an X value.BoundsaddYValue(GeoPoint point)Add a Y value.BoundsaddZValue(GeoPoint point)Add a Z value.booleancheckNoBottomLatitudeBound()Check if there's no bottom latitude bound.booleancheckNoLongitudeBound()Check if there's no longitude bound.booleancheckNoTopLatitudeBound()Check if there's no top latitude bound.java.lang.DoublegetLeftLongitude()Get left longitude, if any.java.lang.DoublegetMaxLatitude()Get maximum latitude, if any.java.lang.DoublegetMinLatitude()Get minimum latitude, if any.java.lang.DoublegetRightLongitude()Get right longitude, if any.BoundsisWide()Signal that the shape exceeds Math.PI in longitude.BoundsnoBottomLatitudeBound()Signal that there is no bottom latitude bound.BoundsnoBound(PlanetModel planetModel)Signal that there is no bound whatsoever.BoundsnoLongitudeBound()Signal that there is no longitude bound.BoundsnoTopLatitudeBound()Signal that there is no top latitude bound.
-
-
-
Field Detail
-
noLongitudeBound
private boolean noLongitudeBound
Set to true if no longitude bounds can be stated
-
noTopLatitudeBound
private boolean noTopLatitudeBound
Set to true if no top latitude bound can be stated
-
noBottomLatitudeBound
private boolean noBottomLatitudeBound
Set to true if no bottom latitude bound can be stated
-
minLatitude
private java.lang.Double minLatitude
If non-null, the minimum latitude bound
-
maxLatitude
private java.lang.Double maxLatitude
If non-null, the maximum latitude bound
-
leftLongitude
private java.lang.Double leftLongitude
If non-null, the left longitude bound
-
rightLongitude
private java.lang.Double rightLongitude
If non-null, the right longitude bound
-
-
Method Detail
-
getMaxLatitude
public java.lang.Double getMaxLatitude()
Get maximum latitude, if any.- Returns:
- maximum latitude or null.
-
getMinLatitude
public java.lang.Double getMinLatitude()
Get minimum latitude, if any.- Returns:
- minimum latitude or null.
-
getLeftLongitude
public java.lang.Double getLeftLongitude()
Get left longitude, if any.- Returns:
- left longitude, or null.
-
getRightLongitude
public java.lang.Double getRightLongitude()
Get right longitude, if any.- Returns:
- right longitude, or null.
-
checkNoLongitudeBound
public boolean checkNoLongitudeBound()
Check if there's no longitude bound.- Returns:
- true if no longitude bound.
-
checkNoTopLatitudeBound
public boolean checkNoTopLatitudeBound()
Check if there's no top latitude bound.- Returns:
- true if no top latitude bound.
-
checkNoBottomLatitudeBound
public boolean checkNoBottomLatitudeBound()
Check if there's no bottom latitude bound.- Returns:
- true if no bottom latitude bound.
-
addPlane
public Bounds addPlane(PlanetModel planetModel, Plane plane, Membership... bounds)
Description copied from interface:BoundsAdd a general plane to the bounds description.
-
addHorizontalPlane
public Bounds addHorizontalPlane(PlanetModel planetModel, double latitude, Plane horizontalPlane, Membership... bounds)
Description copied from interface:BoundsAdd a horizontal plane to the bounds description. This method should EITHER use the supplied latitude, OR use the supplied plane, depending on what is most efficient.- Specified by:
addHorizontalPlanein interfaceBounds- Parameters:
planetModel- is the planet model.latitude- is the latitude.horizontalPlane- is the plane.bounds- are the constraints on the plane.- Returns:
- updated Bounds object.
-
addVerticalPlane
public Bounds addVerticalPlane(PlanetModel planetModel, double longitude, Plane verticalPlane, Membership... bounds)
Description copied from interface:BoundsAdd a vertical plane to the bounds description. This method should EITHER use the supplied longitude, OR use the supplied plane, depending on what is most efficient.- Specified by:
addVerticalPlanein interfaceBounds- Parameters:
planetModel- is the planet model.longitude- is the longitude.verticalPlane- is the plane.bounds- are the constraints on the plane.- Returns:
- updated Bounds object.
-
isWide
public Bounds isWide()
Description copied from interface:BoundsSignal that the shape exceeds Math.PI in longitude.
-
addXValue
public Bounds addXValue(GeoPoint point)
Description copied from interface:BoundsAdd an X value.
-
addYValue
public Bounds addYValue(GeoPoint point)
Description copied from interface:BoundsAdd a Y value.
-
addZValue
public Bounds addZValue(GeoPoint point)
Description copied from interface:BoundsAdd a Z value.
-
addIntersection
public Bounds addIntersection(PlanetModel planetModel, Plane plane1, Plane plane2, Membership... bounds)
Description copied from interface:BoundsAdd the intersection between two planes to the bounds description. Where the shape has intersecting planes, it is better to use this method than just adding the point, since this method takes each plane's error envelope into account.- Specified by:
addIntersectionin interfaceBounds- Parameters:
planetModel- is the planet model.plane1- is the first plane.plane2- is the second plane.bounds- are the membership bounds for the intersection.
-
addPoint
public Bounds addPoint(GeoPoint point)
Description copied from interface:BoundsAdd a single point.
-
noLongitudeBound
public Bounds noLongitudeBound()
Description copied from interface:BoundsSignal that there is no longitude bound.- Specified by:
noLongitudeBoundin interfaceBounds- Returns:
- the updated Bounds object.
-
noTopLatitudeBound
public Bounds noTopLatitudeBound()
Description copied from interface:BoundsSignal that there is no top latitude bound.- Specified by:
noTopLatitudeBoundin interfaceBounds- Returns:
- the updated Bounds object.
-
noBottomLatitudeBound
public Bounds noBottomLatitudeBound()
Description copied from interface:BoundsSignal that there is no bottom latitude bound.- Specified by:
noBottomLatitudeBoundin interfaceBounds- Returns:
- the updated Bounds object.
-
noBound
public Bounds noBound(PlanetModel planetModel)
Description copied from interface:BoundsSignal that there is no bound whatsoever. The bound is limited only by the constraints of the planet.
-
addLatitudeBound
private void addLatitudeBound(double latitude)
Update latitude bound.- Parameters:
latitude- is the latitude.
-
addLongitudeBound
private void addLongitudeBound(double longitude)
Update longitude bound.- Parameters:
longitude- is the new longitude value.
-
-