I don't have much experience in data analysis, so big sorry for anything stupid below.
I have thousands of gps points taken from a public transport vehicle, you can see them below. I would like to get a polyline which would describe "the average route" of this vehicle.
1) I'd like to ignore the outliers, so the points which come from special public transport courses (probably due to blocked roads). To do it I plan to count the number of close points for each point and if it's below N, remove it. Is this the right approach? Any other ideas?
2) About the polyline:
One simple idea would be to take sample of points and just connect them. I'd probably need to do it not randomly, to make sure chosen points are not too close to each other. How do I know in which order should I connect them? Minimize lines length?
Do you have any other ideas? There has to be something more clever and it'd be great if someone would point me in right direction. I'm really interested if it's possible to do it only having coordinates, but it's possible for me to get sequences of points (single routes). How could it be done then?