movingpandas / movingpandas

Movement trajectory classes and functions built on top of GeoPandas
http://movingpandas.org
BSD 3-Clause "New" or "Revised" License
1.24k stars 194 forks source link

Implement trajectory distance measures #37

Open anitagraser opened 5 years ago

anitagraser commented 5 years ago

Useful distance measures include but are not limited to:

For more details, see Zheng & Zhou (2011) who distinguish global and local distance measures:

Others mentioned by Pelekis & Theodoridis (2016)

References

miladad8 commented 2 years ago

Hi. are this measurements(DTW ,LCSS ,...) available on movingpandas?

anitagraser commented 2 years ago

So far, none of the above measurements has been implemented in MovingPandas. Do you happen to know a good existing Python implementation?

miladad8 commented 2 years ago

I've heard of fastdtw python library for measuring similatiry between trajectories, But don't know whether MovingPandas trajectories could be used as an input for this library or not. This library takes two array and a distance method as inputs for measuring similarity.

anitagraser commented 2 years ago

I assume fastdtw's MIT license is compatible with BSD. There's not much code in https://github.com/slaypni/fastdtw so it may be better to add this functionality to MovingPandas directly than to add another dependency that doesn't seem to be under active development. But then again it seems to be Cython ... so not sure what that means for MovingPandas packaging.

anitagraser commented 2 years ago

Hausdorff distance looks like a quick win: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.directed_hausdorff.html

anitagraser commented 2 years ago

Potentially even easier: https://shapely.readthedocs.io/en/stable/manual.html#object.hausdorff_distance

miladad8 commented 2 years ago

i use this libraries

hope it helps.

anitagraser commented 1 year ago

Another potential library: https://github.com/cjekel/similarity_measures

mkh1991 commented 1 month ago

Shapely has Fréchet distance as well now as of 2.x: https://shapely.readthedocs.io/en/stable/reference/shapely.frechet_distance.html#shapely.frechet_distance