Class DiscreteFrechetDistance
java.lang.Object
org.locationtech.jts.algorithm.distance.DiscreteFrechetDistance
The Fréchet distance is a measure of similarity between curves. Thus, it can
be used like the Hausdorff distance.
An analogy for the Fréchet distance taken from
Computing Discrete Fréchet Distance
A man is walking a dog on a leash: the man can move on one curve, the dog on the other; both may vary their speed, but backtracking is not allowed.Its metric is better than the Hausdorff distance because it takes the directions of the curves into account. It is possible that two curves have a small Hausdorff but a large Fréchet distance. This implementation is base on the following optimized Fréchet distance algorithm:
Thomas Devogele, Maxence Esnault, Laurent Etienne. Distance discrète de Fréchet optimisée. Spatial Analysis and Geomatics (SAGEO), Nov 2016, Nice, France. hal-02110055Several matrix storage implementations are provided
-
Constructor Summary
ConstructorsConstructorDescriptionDiscreteFrechetDistance
(Geometry g0, Geometry g1) Creates an instance of this class using the provided geometries. -
Method Summary
Modifier and TypeMethodDescriptionstatic double
Computes the Discrete Fréchet Distance between twoGeometry
s using aCartesian
distance computation function.Gets the pair ofCoordinate
s at which the distance is obtained.
-
Constructor Details
-
DiscreteFrechetDistance
Creates an instance of this class using the provided geometries.- Parameters:
g0
- a geometryg1
- a geometry
-
-
Method Details
-
distance
Computes the Discrete Fréchet Distance between twoGeometry
s using aCartesian
distance computation function.- Parameters:
g0
- the 1st geometryg1
- the 2nd geometry- Returns:
- the cartesian distance between {#g0} and {#g1}
-
getCoordinates
Gets the pair ofCoordinate
s at which the distance is obtained.- Returns:
- the pair of Coordinates at which the distance is obtained
-