| Home | Trees | Indices | Help |
|
|---|
|
|
Fréchet distances.
Classes Frechet, FrechetDegrees, FrechetRadians, FrechetCosineLaw, FrechetDistanceTo, FrechetEquirectangular, FrechetEuclidean, FrechetExact, FrechetFlatLocal, FrechetFlatPolar, FrechetHaversine, FrechetHubeny, FrechetKarney, FrechetThomas and FrechetVincentys to compute discrete Fréchet distances between two sets of
LatLon, NumPy, tuples or other
types of points.
Only FrechetDistanceTo -iff used with ellipsoidalKarney.LatLon points- and FrechetKarney requires installation of Charles Karney's geographiclib.
Typical usage is as follows. First, create a Frechet
calculator from one set of LatLon points.
f = FrechetXyz(point1s, ...)
Get the discrete Fréchet distance to another set of
LatLon points by
t6 = f.discrete(point2s)
Or, use function frechet_ with a proper
distance function passed as keyword arguments as follows
t6 = frechet_(point1s, point2s, ..., distance=...).
In both cases, the returned result t6 is a Frechet6Tuple.
For (lat, lon, ...) points in a NumPy array
or plain tuples, wrap the points in a Numpy2LatLon respectively Tuple2LatLon instance, more details in the documentation
thereof.
For other points, create a Frechet
sub-class with the appropriate distance method overloading
Frechet.distance as in this example.
>>> from pygeodesy import Frechet, hypot_ >>> >>> class F3D(Frechet): >>> """Custom Frechet example. >>> """ >>> def distance(self, p1, p2): >>> return hypot_(p1.x - p2.x, p1.y - p2.y, p1.z - p2.z) >>> >>> f3D = F3D(xyz1, ..., units="...") >>> t6 = f3D.discrete(xyz2)
Transcribed from the original Computing Discrete Fréchet Distance by Eiter, T. and Mannila, H., 1994, April 25, Technical Report CD-TR 94/64, Information Systems Department/Christian Doppler Laboratory for Expert Systems, Technical University Vienna, Austria.
This Frechet.discrete implementation optionally generates
intermediate points for each point set separately. For example, using
keyword argument fraction=0.5 adds one additional point
halfway between each pair of points. Or using fraction=0.1
interpolates nine additional points between each points pair.
The Frechet6Tuple attributes fi1 and/or
fi2 will be fractional indices of type
float if keyword argument fraction is used.
Otherwise, fi1 and/or fi2 are simply type
int indices into the respective points set.
For example, fractional index value 2.5 means an
intermediate point halfway between points[2] and points[3]. Use function
fractional to obtain the intermediate point for a
fractional index in the corresponding set of points.
The Fréchet distance was introduced in 1906 by Maurice Fréchet, see reference [6]. It is a measure of similarity between
curves that takes into account the location and ordering of the points.
Therefore, it is often a better metric than the well-known
Hausdorff distance, see the hausdorff
module.
Version: 25.05.26
| Classes | |
|
FrechetError Fréchet issue. |
|
|
Frechet Frechet base class, requires method Frechet.distance to be overloaded. |
|
|
FrechetDegrees DEPRECATED, use an other Frechet* class.
|
|
|
FrechetRadians DEPRECATED, use an other Frechet* class.
|
|
|
FrechetCosineLaw Compute the Frechet distance with functionn pygeodesy.cosineLaw.
|
|
|
FrechetDistanceTo Compute the Frechet distance with the point1s'
LatLon.distanceTo method.
|
|
|
FrechetEquirectangular Compute the Frechet distance with function pygeodesy.equirectangular.
|
|
|
FrechetEuclidean Compute the Frechet distance with function pygeodesy.euclidean.
|
|
|
FrechetExact Compute the Frechet distance with method GeodesicExact.Inverse.
|
|
|
FrechetFlatLocal Compute the Frechet distance with function pygeodesy.flatLocal_/pygeodesy.hubeny.
|
|
|
FrechetFlatPolar Compute the Frechet distance with function flatPolar_.
|
|
|
FrechetHaversine Compute the Frechet distance with function pygeodesy.haversine_.
|
|
|
FrechetHubeny Compute the Frechet distance with function pygeodesy.flatLocal_/pygeodesy.hubeny.
|
|
|
FrechetKarney Compute the Frechet distance with Karney's geographiclib geodesic.Geodesic.Inverse method.
|
|
|
FrechetThomas Compute the Frechet distance with function pygeodesy.thomas_.
|
|
|
Frechet6Tuple 6-Tuple (fd, fi1, fi2, r, n, units) with the
discrete Fréchet distance fd,
fractional indices fi1 and fi2 as
FIx, the recursion depth r, the number of
distances computed n and the units class or name of the distance
units.
|
|
|
FrechetVincentys Compute the Frechet distance with function pygeodesy.vincentys_.
|
|
| Functions | |||
|
|||
| Variables | |
__all__ = _ALL_LAZY.frechet
|
|
| Function Details |
Compute the discrete Fréchet distance between two paths, each given as a set of points.
Note:
Function frechet_ does not support fractional
indices for intermediate See Also: Non-recursive dp_frechet_dist. |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Nov 6 10:52:29 2025 | http://epydoc.sourceforge.net |