Strava defines segments and times how much time you spend in them while running or cycling using GPS data. I\'m interested in how they do that algorithmically: