public final class SpatialUtil extends Object
Constructor and Description |
---|
SpatialUtil() |
Modifier and Type | Method and Description |
---|---|
static double[] |
centroid(SpatialComparable obj)
Returns the centroid of this SpatialComparable.
|
static double[] |
centroid(SpatialComparable obj,
int start,
int end)
Returns the centroid of the specified values of this SpatialComparable.
|
static boolean |
contains(SpatialComparable box,
double[] point)
Returns true if this SpatialComparable contains the given point, false
otherwise.
|
static boolean |
contains(SpatialComparable box1,
SpatialComparable box2)
Returns true if the first SpatialComparable contains the second
SpatialComparable, false otherwise.
|
static boolean |
equals(SpatialComparable box1,
SpatialComparable box2)
Test two SpatialComparables for equality.
|
static double[] |
getMax(SpatialComparable box)
Returns a clone of the maximum hyper point.
|
static double[] |
getMin(SpatialComparable box)
Returns a clone of the minimum hyper point.
|
static boolean |
intersects(SpatialComparable box1,
SpatialComparable box2)
Returns true if the two SpatialComparables intersect, false otherwise.
|
static double |
perimeter(SpatialComparable box)
Computes the perimeter of this SpatialComparable.
|
static double |
relativeOverlap(SpatialComparable box1,
SpatialComparable box2)
Computes the volume of the overlapping box between two SpatialComparables
and return the relation between the volume of the overlapping box and the
volume of both SpatialComparable.
|
static HyperBoundingBox |
union(SpatialComparable box1,
SpatialComparable box2)
Computes the union HyperBoundingBox of two SpatialComparables.
|
static HyperBoundingBox |
unionTolerant(SpatialComparable mbr1,
SpatialComparable mbr2)
Returns the union of the two specified MBRs.
|
static double |
volume(SpatialComparable box)
Computes the volume of this SpatialComparable
|
public static double[] getMin(SpatialComparable box)
public static double[] getMax(SpatialComparable box)
public static boolean intersects(SpatialComparable box1, SpatialComparable box2)
box1
- the first SpatialComparablebox2
- the first SpatialComparablepublic static boolean contains(SpatialComparable box1, SpatialComparable box2)
box1
- the outer SpatialComparablebox2
- the inner SpatialComparablepublic static boolean contains(SpatialComparable box, double[] point)
point
- the point to be tested for containmentpublic static double volume(SpatialComparable box)
public static double perimeter(SpatialComparable box)
public static double relativeOverlap(SpatialComparable box1, SpatialComparable box2)
box1
- the first SpatialComparablebox2
- the second SpatialComparablepublic static HyperBoundingBox union(SpatialComparable box1, SpatialComparable box2)
box1
- the first SpatialComparablebox2
- the second SpatialComparablepublic static HyperBoundingBox unionTolerant(SpatialComparable mbr1, SpatialComparable mbr2)
mbr1
- the first MBRmbr2
- the second MBRpublic static double[] centroid(SpatialComparable obj)
obj
- Spatial object to processpublic static double[] centroid(SpatialComparable obj, int start, int end)
obj
- Spatial object to processstart
- the start dimension to be consideredend
- the end dimension to be consideredpublic static boolean equals(SpatialComparable box1, SpatialComparable box2)
box1
- First bounding boxbox2
- Second bounding box