Package org.apache.lucene.spatial3d.geom
Class LatLonBounds
java.lang.Object
org.apache.lucene.spatial3d.geom.LatLonBounds
- All Implemented Interfaces:
Bounds
An object for accumulating latitude/longitude bounds information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Double
If non-null, the left longitude boundprivate Double
If non-null, the maximum latitude boundprivate Double
If non-null, the minimum latitude boundprivate boolean
Set to true if no bottom latitude bound can be statedprivate boolean
Set to true if no longitude bounds can be statedprivate boolean
Set to true if no top latitude bound can be statedprivate Double
If non-null, the right longitude bound -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHorizontalPlane
(PlanetModel planetModel, double latitude, Plane horizontalPlane, Membership... bounds) Add a horizontal plane to the bounds description.addIntersection
(PlanetModel planetModel, Plane plane1, Plane plane2, Membership... bounds) Add the intersection between two planes to the bounds description.private void
addLatitudeBound
(double latitude) Update latitude bound.private void
addLongitudeBound
(double longitude) Update longitude bound.addPlane
(PlanetModel planetModel, Plane plane, Membership... bounds) Add a general plane to the bounds description.Add a single point.addVerticalPlane
(PlanetModel planetModel, double longitude, Plane verticalPlane, Membership... bounds) Add a vertical plane to the bounds description.Add an X value.Add a Y value.Add a Z value.boolean
Check if there's no bottom latitude bound.boolean
Check if there's no longitude bound.boolean
Check if there's no top latitude bound.Get left longitude, if any.Get maximum latitude, if any.Get minimum latitude, if any.Get right longitude, if any.isWide()
Signal that the shape exceeds Math.PI in longitude.Signal that there is no bottom latitude bound.noBound
(PlanetModel planetModel) Signal that there is no bound whatsoever.Signal that there is no longitude bound.Signal that there is no top latitude bound.
-
Field Details
-
noLongitudeBound
private boolean noLongitudeBoundSet to true if no longitude bounds can be stated -
noTopLatitudeBound
private boolean noTopLatitudeBoundSet to true if no top latitude bound can be stated -
noBottomLatitudeBound
private boolean noBottomLatitudeBoundSet to true if no bottom latitude bound can be stated -
minLatitude
If non-null, the minimum latitude bound -
maxLatitude
If non-null, the maximum latitude bound -
leftLongitude
If non-null, the left longitude bound -
rightLongitude
If non-null, the right longitude bound
-
-
Constructor Details
-
LatLonBounds
public LatLonBounds()Construct an empty bounds object
-
-
Method Details
-
getMaxLatitude
Get maximum latitude, if any.- Returns:
- maximum latitude or null.
-
getMinLatitude
Get minimum latitude, if any.- Returns:
- minimum latitude or null.
-
getLeftLongitude
Get left longitude, if any.- Returns:
- left longitude, or null.
-
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
Description copied from interface:Bounds
Add a general plane to the bounds description. -
addHorizontalPlane
public Bounds addHorizontalPlane(PlanetModel planetModel, double latitude, Plane horizontalPlane, Membership... bounds) Description copied from interface:Bounds
Add 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:
addHorizontalPlane
in 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:Bounds
Add 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:
addVerticalPlane
in 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
Description copied from interface:Bounds
Signal that the shape exceeds Math.PI in longitude. -
addXValue
Description copied from interface:Bounds
Add an X value. -
addYValue
Description copied from interface:Bounds
Add a Y value. -
addZValue
Description copied from interface:Bounds
Add a Z value. -
addIntersection
public Bounds addIntersection(PlanetModel planetModel, Plane plane1, Plane plane2, Membership... bounds) Description copied from interface:Bounds
Add 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:
addIntersection
in 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
Description copied from interface:Bounds
Add a single point. -
noLongitudeBound
Description copied from interface:Bounds
Signal that there is no longitude bound.- Specified by:
noLongitudeBound
in interfaceBounds
- Returns:
- the updated Bounds object.
-
noTopLatitudeBound
Description copied from interface:Bounds
Signal that there is no top latitude bound.- Specified by:
noTopLatitudeBound
in interfaceBounds
- Returns:
- the updated Bounds object.
-
noBottomLatitudeBound
Description copied from interface:Bounds
Signal that there is no bottom latitude bound.- Specified by:
noBottomLatitudeBound
in interfaceBounds
- Returns:
- the updated Bounds object.
-
noBound
Description copied from interface:Bounds
Signal 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.
-