Class EnvelopeDistance
- java.lang.Object
-
- org.locationtech.jts.index.strtree.EnvelopeDistance
-
public class EnvelopeDistance extends java.lang.Object
Functions for computing distances betweenEnvelope
s.- Author:
- mdavis
-
-
Constructor Summary
Constructors Constructor Description EnvelopeDistance()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
maximumDistance(Envelope env1, Envelope env2)
Computes the maximum distance between the points defining two envelopes.static double
minMaxDistance(Envelope a, Envelope b)
Computes the Min-Max Distance between twoEnvelope
s.
-
-
-
Method Detail
-
maximumDistance
public static double maximumDistance(Envelope env1, Envelope env2)
Computes the maximum distance between the points defining two envelopes. It is equal to the length of the diagonal of the envelope containing both input envelopes. This is a coarse upper bound on the distance between geometries bounded by the envelopes.- Parameters:
env1
- an envelopeenv2
- an envelope- Returns:
- the maximum distance between the points defining the envelopes
-
minMaxDistance
public static double minMaxDistance(Envelope a, Envelope b)
Computes the Min-Max Distance between twoEnvelope
s. It is equal to the minimum of the maximum distances between all pairs of edge segments from the two envelopes. This is the tight upper bound on the distance between geometric items bounded by the envelopes.Theoretically this bound can be used in the R-tree nearest-neighbour branch-and-bound search instead of
maximumDistance(Envelope, Envelope)
. However, little performance improvement is observed in practice.- Parameters:
a
- an envelopeb
- an envelope- Returns:
- the min-max-distance between the envelopes
-
-