GEOS 3.15.0dev
|
The Fréchet distance is a measure of similarity between curves. Thus, it can be used like the Hausdorff distance. More...
#include <DiscreteFrechetDistance.h>
Classes | |
class | CsrMatrix |
class | HashMapMatrix |
class | MatrixStorage |
class | RectMatrix |
Public Member Functions | |
DiscreteFrechetDistance (const geom::Geometry &geom0, const geom::Geometry &geom1) | |
std::array< geom::CoordinateXY, 2 > | getCoordinates () |
void | setDensifyFraction (double dFrac) |
Static Public Member Functions | |
static double | distance (const geom::Geometry &geom0, const geom::Geometry &geom1) |
static double | distance (const geom::Geometry &geom0, const geom::Geometry &geom1, double densityFrac) |
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-02110055
Several matrix storage implementations are provided
|
inline |
Creates an instance of this class using the provided geometries.
geom0 | a geometry |
geom1 | a geometry |
|
static |
Computes the Discrete Fréchet Distance between two Geometrys using a Cartesian distance computation function.
geom0 | the 1st geometry |
geom1 | the 2nd geometry |
|
static |
Computes the Discrete Fréchet Distance between two Geometrys using a Cartesian distance computation function.
geom0 | the 1st geometry |
geom1 | the 2nd geometry |
densityFrac | the fraction of edge length to target when densifying edges |
std::array< geom::CoordinateXY, 2 > geos::algorithm::distance::DiscreteFrechetDistance::getCoordinates | ( | ) |
Gets the pair of geom::Coordinate
s at which the distance is obtained.