joaofig / discrete-frechet

Implementation of the discrete Fréchet distance
MIT License
56 stars 12 forks source link

discrete-frechet

A dive into the discrete Fréchet distance calculation, from the naïve approach to high-speed and memory-efficient optimizations.

The discrete Fréchet distance measures the similarity between two polygonal curves or polylines.

This repository contains four different implementations of the discrete Fréchet distance calculation.

Medium Articles

How long should your dog leash be?

Fast Discrete Fréchet Distance

Using the Code

The DFD classes live in the distances package. They are:

To use the code, select the class to instantiate and initialize it with one of the following distance functions:

All distance functions take the point parameters as NumPy arrays and return the distance as a single float. The haversine distance functions reverse the parameter indexing order. Instead of (x, y), they take (lat, lon). The hearth_haversine function takes its inputs in decimal degrees.

Use the distance function of your selected class to calculate the DFD.