Package org.apache.lucene.spatial3d.geom
Class dXdYZSolid
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.BasePlanetObject
-
- org.apache.lucene.spatial3d.geom.BaseXYZSolid
-
- org.apache.lucene.spatial3d.geom.dXdYZSolid
-
- All Implemented Interfaces:
GeoArea
,Membership
,PlanetObject
,SerializableObject
,XYZSolid
class dXdYZSolid extends BaseXYZSolid
3D rectangle, bounded on six sides by X,Y,Z limits, degenerate in X and Y. This figure, in fact, represents either zero, one, or two points, so the actual data stored is minimal.
-
-
Field Summary
Fields Modifier and Type Field Description protected double
maxZ
Max-Zprotected double
minZ
Min-Zprotected GeoPoint[]
surfacePoints
The points in this figure on the planet surface; also doubles for edge pointsprotected double
X
Xprotected double
Y
Y-
Fields inherited from class org.apache.lucene.spatial3d.geom.BaseXYZSolid
ALL_INSIDE, EMPTY_POINTS, NO_EDGEPOINTS, NONE_INSIDE, SOME_INSIDE, xUnitVector, xVerticalPlane, yUnitVector, yVerticalPlane, zUnitVector
-
Fields inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
planetModel
-
-
Constructor Summary
Constructors Constructor Description dXdYZSolid(PlanetModel planetModel, double X, double Y, double minZ, double maxZ)
Sole constructordXdYZSolid(PlanetModel planetModel, java.io.InputStream inputStream)
Constructor for deserialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
protected GeoPoint[]
getEdgePoints()
Get the edge points for this shape.int
getRelationship(GeoShape path)
Find the spatial relationship between a shape and the current geo area.int
hashCode()
boolean
isWithin(double x, double y, double z)
Check if a point is within this shape.java.lang.String
toString()
void
write(java.io.OutputStream outputStream)
Serialize to output stream.-
Methods inherited from class org.apache.lucene.spatial3d.geom.BaseXYZSolid
glueTogether, isAreaInsideShape, isShapeInsideArea, isWithin
-
Methods inherited from class org.apache.lucene.spatial3d.geom.BasePlanetObject
getPlanetModel
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.spatial3d.geom.PlanetObject
getPlanetModel
-
-
-
-
Field Detail
-
X
protected final double X
X
-
Y
protected final double Y
Y
-
minZ
protected final double minZ
Min-Z
-
maxZ
protected final double maxZ
Max-Z
-
surfacePoints
protected final GeoPoint[] surfacePoints
The points in this figure on the planet surface; also doubles for edge points
-
-
Constructor Detail
-
dXdYZSolid
public dXdYZSolid(PlanetModel planetModel, double X, double Y, double minZ, double maxZ)
Sole constructor- Parameters:
planetModel
- is the planet model.X
- is the X value.Y
- is the Y value.minZ
- is the minimum Z value.maxZ
- is the maximum Z value.
-
dXdYZSolid
public dXdYZSolid(PlanetModel planetModel, java.io.InputStream inputStream) throws java.io.IOException
Constructor for deserialization.- Parameters:
planetModel
- is the planet model.inputStream
- is the input stream.- Throws:
java.io.IOException
-
-
Method Detail
-
write
public void write(java.io.OutputStream outputStream) throws java.io.IOException
Description copied from interface:SerializableObject
Serialize to output stream.- Specified by:
write
in interfaceSerializableObject
- Overrides:
write
in classBasePlanetObject
- Parameters:
outputStream
- is the output stream to write to.- Throws:
java.io.IOException
-
getEdgePoints
protected GeoPoint[] getEdgePoints()
Description copied from class:BaseXYZSolid
Get the edge points for this shape.- Specified by:
getEdgePoints
in classBaseXYZSolid
- Returns:
- the edge points.
-
isWithin
public boolean isWithin(double x, double y, double z)
Description copied from interface:Membership
Check if a point is within this shape.- Specified by:
isWithin
in interfaceMembership
- Specified by:
isWithin
in classBaseXYZSolid
- 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
-
getRelationship
public int getRelationship(GeoShape path)
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.
- Parameters:
path
- is the shape to consider.- Returns:
- the relationship, from the perspective of the shape.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classBaseXYZSolid
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBaseXYZSolid
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-