Package org.apache.lucene.spatial3d.geom
Class GeoBaseAreaShape
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.BasePlanetObject
-
- org.apache.lucene.spatial3d.geom.GeoBaseShape
-
- org.apache.lucene.spatial3d.geom.GeoBaseMembershipShape
-
- org.apache.lucene.spatial3d.geom.GeoBaseAreaShape
-
- All Implemented Interfaces:
Bounded
,GeoArea
,GeoAreaShape
,GeoMembershipShape
,GeoOutsideDistance
,GeoShape
,Membership
,PlanetObject
,SerializableObject
- Direct Known Subclasses:
GeoBaseBBox
,GeoBaseDistanceShape
,GeoBasePolygon
abstract class GeoBaseAreaShape extends GeoBaseMembershipShape implements GeoAreaShape
Base extended areaShape object.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
ALL_INSIDE
All edgepoints inside shapeprotected static int
NONE_INSIDE
No edgepoints inside shapeprotected static int
SOME_INSIDE
Some edgepoints inside shape-
Fields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel
-
-
Constructor Summary
Constructors Constructor Description GeoBaseAreaShape(PlanetModel planetModel)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getRelationship(GeoShape geoShape)
Find the spatial relationship between a shape and the current geo area.protected int
isGeoAreaShapeInsideShape(GeoShape geoshape)
Determine the relationship between the GeoAreaShape's edgepoints and the provided shape.protected int
isShapeInsideGeoAreaShape(GeoShape geoShape)
Determine the relationship between the GeoAreShape and the shape's edgepoints.-
Methods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseMembershipShape
computeOutsideDistance, computeOutsideDistance, isWithin, outsideDistance
-
Methods inherited from class org.apache.lucene.spatial3d.geom.GeoBaseShape
getBounds
-
Methods inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
equals, getPlanetModel, hashCode, write
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.GeoAreaShape
intersects
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.GeoOutsideDistance
computeOutsideDistance, computeOutsideDistance
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.GeoShape
getEdgePoints, intersects
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.Membership
isWithin, isWithin
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.PlanetObject
getPlanetModel
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.SerializableObject
write
-
-
-
-
Field Detail
-
ALL_INSIDE
protected static final int ALL_INSIDE
All edgepoints inside shape- See Also:
- Constant Field Values
-
SOME_INSIDE
protected static final int SOME_INSIDE
Some edgepoints inside shape- See Also:
- Constant Field Values
-
NONE_INSIDE
protected static final int NONE_INSIDE
No edgepoints inside shape- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GeoBaseAreaShape
public GeoBaseAreaShape(PlanetModel planetModel)
Constructor.- Parameters:
planetModel
- is the planet model to use.
-
-
Method Detail
-
isShapeInsideGeoAreaShape
protected int isShapeInsideGeoAreaShape(GeoShape geoShape)
Determine the relationship between the GeoAreShape and the shape's edgepoints.- Parameters:
geoShape
- is the shape.- Returns:
- the relationship.
-
isGeoAreaShapeInsideShape
protected int isGeoAreaShapeInsideShape(GeoShape geoshape)
Determine the relationship between the GeoAreaShape's edgepoints and the provided shape.- Parameters:
geoshape
- is the shape.- Returns:
- the relationship.
-
getRelationship
public int getRelationship(GeoShape geoShape)
Description copied from interface:GeoArea
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.
- Specified by:
getRelationship
in interfaceGeoArea
- Parameters:
geoShape
- is the shape to consider.- Returns:
- the relationship, from the perspective of the shape.
-
-