Module org.apache.lucene.spatial3d
Package org.apache.lucene.spatial3d.geom
Class GeoDegeneratePoint
java.lang.Object
org.apache.lucene.spatial3d.geom.Vector
org.apache.lucene.spatial3d.geom.GeoPoint
org.apache.lucene.spatial3d.geom.GeoDegeneratePoint
- All Implemented Interfaces:
Bounded,GeoArea,GeoAreaShape,GeoBBox,GeoBounds,GeoCircle,GeoDistance,GeoDistanceShape,GeoMembershipShape,GeoOutsideDistance,GeoPointShape,GeoShape,GeoSizeable,Membership,PlanetObject,SerializableObject
This class represents a degenerate point bounding box. It is not a simple GeoPoint because we
must have the latitude and longitude.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GeoPoint[]Edge point is an area containing just thisprotected final PlanetModelCurrent planet model, since we don't extend BasePlanetObjectFields inherited from class org.apache.lucene.spatial3d.geom.GeoPoint
latitude, longitude, magnitudeFields inherited from class org.apache.lucene.spatial3d.geom.Vector
MINIMUM_ANGULAR_RESOLUTION, MINIMUM_RESOLUTION, MINIMUM_RESOLUTION_CUBED, MINIMUM_RESOLUTION_SQUARED, x, y, z -
Constructor Summary
ConstructorsConstructorDescriptionGeoDegeneratePoint(PlanetModel planetModel, double lat, double lon) Constructor.GeoDegeneratePoint(PlanetModel planetModel, InputStream inputStream) Constructor for deserialization. -
Method Summary
Modifier and TypeMethodDescriptiondoublecomputeDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute this shape's internal "distance" to the GeoPoint.doublecomputeOutsideDistance(DistanceStyle distanceStyle, double x, double y, double z) Compute this shape's distance to the GeoPoint.doublecomputeOutsideDistance(DistanceStyle distanceStyle, GeoPoint point) Compute this shape's distance to the GeoPoint.booleanexpand(double angle) Expand box by specified angle.voidCompute bounds for the shape.Returns the center of a circle into which the area will be inscribed.voidgetDistanceBounds(Bounds bounds, DistanceStyle distanceStyle, double distanceValue) Compute a bound based on a provided distance measure.GeoPoint[]Return a sample point that is on the outside edge/boundary of the shape.Returns thePlanetModelprovided when this shape was created.doubleReturns the radius of a circle into which the GeoSizeable area can be inscribed.intgetRelationship(GeoShape shape) Find the spatial relationship between a shape and the current geo area.booleanintersects(GeoShape geoShape) Assess whether a shape intersects with any of the edges of this shape.booleanintersects(Plane plane, GeoPoint[] notablePoints, Membership... bounds) Assess whether a plane, within the provided bounds, intersects with the shape's edges.booleanisWithin(double x, double y, double z) Check if a point is within this shape.booleanCheck if a point is within this shape.toString()Methods inherited from class org.apache.lucene.spatial3d.geom.GeoPoint
arcDistance, arcDistance, getLatitude, getLongitude, isIdentical, isIdentical, magnitude, writeMethods inherited from class org.apache.lucene.spatial3d.geom.Vector
computeDesiredEllipsoidMagnitude, computeDesiredEllipsoidMagnitude, crossProductEvaluateIsZero, dotProduct, dotProduct, hashCode, isNumericallyIdentical, isNumericallyIdentical, isParallel, isParallel, isWithin, linearDistance, linearDistance, linearDistanceSquared, linearDistanceSquared, magnitude, normalDistance, normalDistance, normalDistanceSquared, normalDistanceSquared, normalize, rotateXY, rotateXY, rotateXZ, rotateXZ, rotateZY, rotateZY, translateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.lucene.spatial3d.geom.GeoDistance
computeDeltaDistance, computeDeltaDistance, computeDistanceMethods inherited from interface org.apache.lucene.spatial3d.geom.SerializableObject
write
-
Field Details
-
planetModel
Current planet model, since we don't extend BasePlanetObject -
edgePoints
Edge point is an area containing just this
-
-
Constructor Details
-
GeoDegeneratePoint
Constructor.- Parameters:
planetModel- is the planet model to use.lat- is the latitude.lon- is the longitude.
-
GeoDegeneratePoint
Constructor for deserialization.- Parameters:
planetModel- is the planet model to use.inputStream- is the input stream.- Throws:
IOException
-
-
Method Details
-
getPlanetModel
Description copied from interface:PlanetObjectReturns thePlanetModelprovided when this shape was created.- Specified by:
getPlanetModelin interfacePlanetObject
-
expand
Description copied from interface:GeoBBoxExpand box by specified angle. -
getEdgePoints
Description copied from interface:GeoShapeReturn a sample point that is on the outside edge/boundary of the shape.- Specified by:
getEdgePointsin interfaceGeoShape- Returns:
- samples of all edge points from distinct edge sections. Typically one point is returned, but zero or two are also possible.
-
intersects
Description copied from interface:GeoShapeAssess whether a plane, within the provided bounds, intersects with the shape's edges. Any overlap, even a single point, is considered to be an intersection. Note well that this method is allowed to return "true" if there are internal edges of a composite shape which intersect the plane. Doing this can cause getRelationship() for most GeoBBox shapes to return OVERLAPS rather than the more correct CONTAINS, but that cannot be helped for some complex shapes that are built out of overlapping parts.- Specified by:
intersectsin interfaceGeoShape- Parameters:
plane- is the plane to assess for intersection with the shape's edges or bounding curves.notablePoints- represents the intersections of the plane with the supplied bounds. These are used to disambiguate when two planes are identical and it needs to be determined whether any points exist that fulfill all the bounds.bounds- are a set of bounds that define an area that an intersection must be within in order to qualify (provided by a GeoArea).- Returns:
- true if there's such an intersection, false if not.
-
intersects
Description copied from interface:GeoAreaShapeAssess whether a shape intersects with any of the edges of this shape. Note well that this method must return false if the shape contains or is disjoint with the given shape. It is permissible to return true if the shape is within the specified shape, if it is difficult to compute intersection with edges.- Specified by:
intersectsin interfaceGeoAreaShape- Parameters:
geoShape- is the shape to assess for intersection with this shape's edges.- Returns:
- true if there's such an intersection, false if not.
-
getBounds
Description copied from interface:BoundedCompute bounds for the shape. -
computeOutsideDistance
Description copied from interface:GeoOutsideDistanceCompute this shape's distance to the GeoPoint. A return value of 0.0 should be returned for points inside of the shape.- Specified by:
computeOutsideDistancein interfaceGeoOutsideDistance- Parameters:
distanceStyle- is the distance style.point- is the point to compute the distance to.- Returns:
- the distance.
-
computeOutsideDistance
Description copied from interface:GeoOutsideDistanceCompute this shape's distance to the GeoPoint. A return value of 0.0 should be returned for points inside of the shape.- Specified by:
computeOutsideDistancein interfaceGeoOutsideDistance- Parameters:
distanceStyle- is the distance style.x- is the point's unit x coordinate (using U.S. convention).y- is the point's unit y coordinate (using U.S. convention).z- is the point's unit z coordinate (using U.S. convention).- Returns:
- the distance.
-
equals
-
toString
-
isWithin
Description copied from interface:MembershipCheck if a point is within this shape.- Specified by:
isWithinin interfaceMembership- Parameters:
point- is the point to check.- Returns:
- true if the point is within this shape
-
isWithin
public boolean isWithin(double x, double y, double z) Description copied from interface:MembershipCheck if a point is within this shape.- Specified by:
isWithinin interfaceMembership- Parameters:
x- is x coordinate of point to check.y- is y coordinate of point to check.z- is z coordinate of point to check.- Returns:
- true if the point is within this shape
-
getRadius
public double getRadius()Description copied from interface:GeoSizeableReturns the radius of a circle into which the GeoSizeable area can be inscribed.- Specified by:
getRadiusin interfaceGeoSizeable- Returns:
- the radius.
-
getCenter
Description copied from interface:GeoSizeableReturns the center of a circle into which the area will be inscribed.- Specified by:
getCenterin interfaceGeoSizeable- Returns:
- the center.
-
getRelationship
Description copied from interface:GeoAreaFind the spatial relationship between a shape and the current geo area. Note: return value is how the GeoShape relates to the GeoArea, not the other way around. For example, if this GeoArea is entirely within the shape, then CONTAINS should be returned. If the shape is entirely enclosed by this GeoArea, then WITHIN should be returned.It is permissible to return OVERLAPS instead of WITHIN if the shape intersects with the area at even a single point. So, a circle inscribed in a rectangle could return either OVERLAPS or WITHIN, depending on implementation. It is not permissible to return CONTAINS or DISJOINT in this circumstance, however.
Similarly, it is permissible to return OVERLAPS instead of CONTAINS under conditions where the shape consists of multiple independent overlapping subshapes, and the area overlaps one of the subshapes. It is not permissible to return WITHIN or DISJOINT in this circumstance, however.
- Specified by:
getRelationshipin interfaceGeoArea- Parameters:
shape- is the shape to consider.- Returns:
- the relationship, from the perspective of the shape.
-
computeDistance
Description copied from interface:GeoDistanceCompute this shape's internal "distance" to the GeoPoint. Implementations should clarify how this is computed when it's non-obvious. A return value of Double.POSITIVE_INFINITY should be returned for points outside of the shape.- Specified by:
computeDistancein interfaceGeoDistance- Parameters:
distanceStyle- is the distance style.x- is the point's unit x coordinate (using U.S. convention).y- is the point's unit y coordinate (using U.S. convention).z- is the point's unit z coordinate (using U.S. convention).- Returns:
- the distance.
-
getDistanceBounds
Description copied from interface:GeoDistanceShapeCompute a bound based on a provided distance measure. This method takes an input distance and distance metric and provides bounds on the shape if reduced to match that distance. The method is allowed to return bounds that are larger than the distance would indicate, but never smaller.- Specified by:
getDistanceBoundsin interfaceGeoDistanceShape- Parameters:
bounds- is the bounds object to update.distanceStyle- describes the type of distance metric provided.distanceValue- is the distance metric to use. It is presumed that the distance metric was produced with the same distance style as is provided to this method.
-