Package org.apache.lucene.spatial3d.geom
Interface GeoArea
- All Superinterfaces:
Membership
- All Known Subinterfaces:
GeoAreaShape
,GeoBBox
,GeoCircle
,GeoDistanceShape
,GeoPath
,GeoPointShape
,GeoPolygon
,XYZSolid
- All Known Implementing Classes:
GeoBaseDistanceShape
,GeoCompositeAreaShape
,GeoCompositePolygon
,GeoDegenerateVerticalLine
A GeoArea represents a standard 2-D breakdown of a part of sphere. It can be bounded in latitude,
or bounded in both latitude and longitude, or not bounded at all. The purpose of the interface is
to describe bounding shapes used for computation of geo hashes.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The referenced shape CONTAINS this areastatic final int
The referenced shape has no relation to this areastatic final int
The referenced shape OVERLAPS this areastatic final int
The referenced shape IS WITHIN this area -
Method Summary
Modifier and TypeMethodDescriptionint
getRelationship
(GeoShape shape) Find the spatial relationship between a shape and the current geo area.Methods inherited from interface org.apache.lucene.spatial3d.geom.Membership
isWithin, isWithin
-
Field Details
-
CONTAINS
static final int CONTAINSThe referenced shape CONTAINS this area- See Also:
-
WITHIN
static final int WITHINThe referenced shape IS WITHIN this area- See Also:
-
OVERLAPS
static final int OVERLAPSThe referenced shape OVERLAPS this area- See Also:
-
DISJOINT
static final int DISJOINTThe referenced shape has no relation to this area- See Also:
-
-
Method Details
-
getRelationship
Find 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.
- Parameters:
shape
- is the shape to consider.- Returns:
- the relationship, from the perspective of the shape.
-