Interface TopologyPredicate
public interface TopologyPredicate
The API for strategy classes implementing
spatial predicates based on the DE-9IM topology model.
Predicate values for specific geometry pairs can be evaluated by
RelateNG.- Author:
- Martin Davis
-
Method Summary
Modifier and TypeMethodDescriptionvoidfinish()Indicates that the value of the predicate can be finalized based on its current state.default voidinit(int dimA, int dimB) Initializes the predicate for a specific geometric case.default voidInitializes the predicate for a specific geometric case.booleanisKnown()Tests if the predicate value is known.name()Gets the name of the predicate.default booleanrequireCovers(boolean isSourceA) Reports whether this predicate requires that the source cover the target.default booleanrequireExteriorCheck(boolean isSourceA) Reports whether this predicate requires checking if the source input intersects the Exterior of the target input.default booleanReports whether this predicate requires interaction between the input geometries.default booleanReports whether this predicate requires self-noding for geometries which contain crossing edges (for example,s, or s containing lines or polygons which may self-intersect).invalid reference
LineStringvoidupdateDimension(int locA, int locB, int dimension) Updates the entry in the DE-9IM intersection matrix for givens in the input geometries.invalid reference
Locationbooleanvalue()Gets the current value of the predicate result.
-
Method Details
-
name
-
requireSelfNoding
default boolean requireSelfNoding()Reports whether this predicate requires self-noding for geometries which contain crossing edges (for example,s, or s containing lines or polygons which may self-intersect). Self-noding ensures that intersections are computed consistently in cases which contain self-crossings and mutual crossings.invalid reference
LineStringMost predicates require this, but it can be avoided for simple intersection detection (such as in
RelatePredicate.intersects()andRelatePredicate.disjoint(). Avoiding self-noding improves performance for polygonal inputs.- Returns:
- true if self-noding is required.
-
requireInteraction
default boolean requireInteraction()Reports whether this predicate requires interaction between the input geometries. This is the case ifIM[I, I] >= 0 or IM[I, B] >= 0 or IM[B, I] >= 0 or IM[B, B] >= 0
This allows a fast result if the envelopes of the geometries are disjoint.- Returns:
- true if the geometries must interact
-
requireCovers
default boolean requireCovers(boolean isSourceA) Reports whether this predicate requires that the source cover the target. This is the case ifIM[Ext(Src), Int(Tgt)] = F and IM[Ext(Src), Bdy(Tgt)] = F
If true, this allows a fast result if the source envelope does not cover the target envelope.- Parameters:
isSourceA- indicates the source input geometry- Returns:
- true if the predicate requires checking whether the source covers the target
-
requireExteriorCheck
default boolean requireExteriorCheck(boolean isSourceA) Reports whether this predicate requires checking if the source input intersects the Exterior of the target input. This is the case if:IM[Int(Src), Ext(Tgt)] >= 0 or IM[Bdy(Src), Ext(Tgt)] >= 0
If false, this may permit a faster result in some geometric situations.- Parameters:
isSourceA- indicates the source input geometry- Returns:
- true if the predicate requires checking whether the source intersects the target exterior
-
init
default void init(int dimA, int dimB) Initializes the predicate for a specific geometric case. This may allow the predicate result to become known if it can be inferred from the dimensions.- Parameters:
dimA- the dimension of geometry AdimB- the dimension of geometry B- See Also:
-
init
-
updateDimension
void updateDimension(int locA, int locB, int dimension) Updates the entry in the DE-9IM intersection matrix for givens in the input geometries.invalid reference
LocationIf this method is called with a
value which is less than the current value for the matrix entry, the implementing class should avoid changing the entry if this would cause information loss.invalid reference
Dimension- Parameters:
locA- the location on the A axis of the matrixlocB- the location on the B axis of the matrixdimension- the dimension value for the entry- See Also:
-
finish
void finish()Indicates that the value of the predicate can be finalized based on its current state. -
isKnown
boolean isKnown()Tests if the predicate value is known.- Returns:
- true if the result is known
-
value
boolean value()Gets the current value of the predicate result. The value is only valid ifisKnown()is true.- Returns:
- the predicate result value
-