public enum SpatialRelation extends Enum<SpatialRelation>
Enum Constant and Description |
---|
CONTAINS
The shape contains the target geometry.
|
DISJOINT
The shape shares no point in common with the target shape.
|
INTERSECTS
|
WITHIN
The shape is within the target geometry.
|
Modifier and Type | Method and Description |
---|---|
SpatialRelation |
combine(SpatialRelation other)
If you were to call aShape.relate(bShape) and aShape.relate(cShape), you
could call this to merge the intersect results as if bShape & cShape were
combined into
ShapeCollection . |
boolean |
intersects()
Not DISJOINT, i.e.
|
SpatialRelation |
inverse()
If
aShape.relate(bShape) is r, then r.inverse()
is inverse(aShape).relate(bShape) whereas
inverse(shape) is theoretically the opposite area covered by a
shape, i.e. |
SpatialRelation |
transpose()
Given the result of
shapeA.relate(shapeB) , transposing that
result should yield the result of shapeB.relate(shapeA) . |
static SpatialRelation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SpatialRelation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SpatialRelation WITHIN
CONTAINS
.
Boundaries of shapes count too. OGC specs refer to this relation as "COVERED BY";
WITHIN is differentiated there by not including boundaries.public static final SpatialRelation CONTAINS
WITHIN
.
Boundaries of shapes count too. OGC specs refer to this relation as "COVERS";
CONTAINS is differentiated there by not including boundaries.public static final SpatialRelation DISJOINT
public static final SpatialRelation INTERSECTS
public static SpatialRelation[] values()
for (SpatialRelation c : SpatialRelation.values()) System.out.println(c);
public static SpatialRelation valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic SpatialRelation transpose()
shapeA.relate(shapeB)
, transposing that
result should yield the result of shapeB.relate(shapeA)
. There
is a corner case is when the shapes are equal, in which case actually
flipping the relate() call will result in the same value -- either CONTAINS
or WITHIN; this method can't possible check for that so the caller might
have to.public SpatialRelation combine(SpatialRelation other)
ShapeCollection
.public boolean intersects()
public SpatialRelation inverse()
aShape.relate(bShape)
is r, then r.inverse()
is inverse(aShape).relate(bShape)
whereas
inverse(shape)
is theoretically the opposite area covered by a
shape, i.e. everywhere but where the shape is.
Note that it's not commutative! WITHIN.inverse().inverse() !=
WITHIN
.Copyright © 2015. All rights reserved.