If I have got different routes - a series of (lat, lng) points, how to get the similarity of different routes?
I would go about this problem using the following approach:


Create a poly-line for the baseline trip.
Create a buffer zone (closed polygon) around this poly-line using a small radius, say 20 meters.
Using the points in the second trip, calculate the fraction of points that lie outside the buffer zone.


A fraction of zero means that all points from the second trip lie inside the first trip's buffer zone, while a fraction of one means that all lie outside.

You can use this fraction as a measure of dissimilarity, where 1 means that both trips are completely dissimilar and 0 means completely similar (within the given buffer radius). For completeness, you might want to reverse the poly-line roles and calculate the "reverse" similarity. Your final similarity score could then be the product of both.

I usually implement my algorithms in C# using .NET and for these purposes I use Microsoft's System.Spatial NuGet package. Here you can find methods like STBuffer and STContains that will greatly help to implement this.