0

I am developing an mobile application for recording user trips. A trip is made by sequences of user positions (with longitude and latitude values).

Now my problem is how to determine a trip has been traveled so far? On the other words, how to determine duplicated paths between trips?

(I know that we could not have 2 trips with the exact same data points, hence, I don't know how to begin with, I am looking for an algorithm could approximately address this problem).

Thank for your help!

Chiến Nghê
  • 736
  • 2
  • 9
  • 25
  • At what point should 2 trips be considered equal in your scenario? (1)When start and end points are equivalent, (2) when the whole path is equivalent, (3) when large parts of the path are equivalent or (4) something else? – SaiBot Mar 13 '18 at 09:17
  • It's great if I could get (3), of course, we could set a threshold for indicating how large is enough (for example 80% paths matched) – Chiến Nghê Mar 13 '18 at 09:24
  • Sounds like [Longest Common Subsequence Problem](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem) if the order of positions matters; otherwise just get the intersection of sets of positions. But both require the paths to have "exact same data points", but this could be achieved e.g. by "rounding" the positions (rounding lat/long to a certain number of decimal places, or even to streets, districts, or visited cities). – tobias_k Mar 13 '18 at 09:38

1 Answers1

0

There are a couple of trajectory distance measures that could help: Euclidean Distance, Dynamic Time Wraping, Edit Distance with Real Penalty, LCSS, ... Which one to pick depends on how you want to define similarity.

In this paper the authors describe all distance measures and evaluate them.

As far as I understand your scenario an LCSS or ERP based similarity measure might fit. A quick search brought me to this Github Repository

SaiBot
  • 3,595
  • 1
  • 13
  • 19