Class FrechetSimilarityMeasure

  • All Implemented Interfaces:
    SimilarityMeasure

    public class FrechetSimilarityMeasure
    extends java.lang.Object
    implements SimilarityMeasure
    Measures the degree of similarity between two Geometrys using the Fréchet 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 Fréchet distance between the input geometries, and then normalizing this by dividing it by the diagonal distance across the envelope of the combined geometries.

    Note: the input should be normalized, especially when measuring MultiPoint geometries because for the Fréchet distance the order of Coordinates is important.

    Author:
    Felix Obermaier
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double measure​(Geometry g1, Geometry g2)
      Computes the similarity measure between two geometries
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FrechetSimilarityMeasure

        public FrechetSimilarityMeasure()
        Creates an instance of this class.
    • 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 interface SimilarityMeasure
        Parameters:
        g1 - a geometry
        g2 - a geometry
        Returns:
        the value of the similarity measure, in [0.0, 1.0]