public class DiscreteFrechetDistance extends Object
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 and Description |
---|
DiscreteFrechetDistance(Geometry g0,
Geometry g1)
Creates an instance of this class using the provided geometries.
|
Modifier and Type | Method and Description |
---|---|
static double |
distance(Geometry g0,
Geometry g1)
Computes the Discrete Fréchet Distance between two
Geometry s
using a Cartesian distance computation function. |
Coordinate[] |
getCoordinates()
Gets the pair of
Coordinate s at which the distance is obtained. |
public static double distance(Geometry g0, Geometry g1)
Geometry
s
using a Cartesian
distance computation function.g0
- the 1st geometryg1
- the 2nd geometrypublic Coordinate[] getCoordinates()
Coordinate
s at which the distance is obtained.Copyright © 2024. All rights reserved.