Class HausdorffSimilarityMeasure
- java.lang.Object
-
- org.locationtech.jts.algorithm.match.HausdorffSimilarityMeasure
-
- All Implemented Interfaces:
SimilarityMeasure
public class HausdorffSimilarityMeasure extends java.lang.Object implements SimilarityMeasure
Measures the degree of similarity between twoGeometry
s using the Hausdorff distance metric. The measure is normalized to lie in the range [0, 1]. Higher measures indicate a great degree of similarity.The measure is computed by computing the Hausdorff distance between the input geometries, and then normalizing this by dividing it by the diagonal distance across the envelope of the combined geometries.
- Author:
- mbdavis
-
-
Constructor Summary
Constructors Constructor Description HausdorffSimilarityMeasure()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
diagonalSize(Envelope env)
double
measure(Geometry g1, Geometry g2)
Computes the similarity measure between two geometries
-
-
-
Method Detail
-
measure
public double measure(Geometry g1, Geometry g2)
Description copied from interface:SimilarityMeasure
Computes the similarity measure between two geometries- Specified by:
measure
in interfaceSimilarityMeasure
- Parameters:
g1
- a geometryg2
- a geometry- Returns:
- the value of the similarity measure, in [0.0, 1.0]
-
diagonalSize
public static double diagonalSize(Envelope env)
-
-