Monday, January 3, 2011

tagging motorized segments in FIT files: results

Last time I described my proposed algorithm for detecting ride segments. The only detail I was missing was how I find where to find the transitions between motorized and nonmotorized transport. I'd set a threshold speed of 14 meters per second, but obviously one doesn't ride a bike up to that speed and then hop onto a passing vehicle. So instead, starting from where the speed crosses the 14 m/sec threshold, I search for the first interval of at least 10 seconds during which there are either no points (GPS off or out of signal range, for example) or else the speed fails to exceed a 2 m/sec threshold. This seems to work fairly well, although it can be tricky, as it may not take long to get off a train after it's stopped. Car-bike transitions probably tend to be slower. I use the time at the mid-point of these points as the threshold time for motorized versus non-motorized.

I then scanned all stored activities for Oct, Nov, and Dec 2010. I found five which showed clear evidence of motor transport: four train, one car. At least one car ride, descending Hicks and Mt Umunhum Roads after the Low-Key Hillclimb, was not tagged. This is because the descent was at a speed consistent with cycling, so it is right that it wasn't marked.

Here's perhaps the most interesting example, an activity where I rode from work to the train station in Mountain View, got a large hole in my tire approaching the station, got off in Palo Alto to buy a new tire, then rode to Menlo Park to catch a train back to San Francisco. The algorithm worked perfectly. Train rides are particularly easy to pick up, because the train builds up speed then sustains it between stations. There's little stop-and-go.

plot

So not perfect, but a lot better than nothing. Next up I need to finish my code to generate a revised FIT file without the motorized segments.

No comments: