I have a bunch of GPS tracks in a Postgres+PostGIS database and want to extract a single metric as a measure of turns shown in the data. Some of the GPS targets travel in almost straight lines while others do some curves. The curves are sometimes all right/left hand turns but most of the time it's just squiggles. I've tried to use the length of the line vs the distance between start/end, or area covered by the convex hull but these aren't perfect.
Can you think of a function that would be able to determine the "curviness" of a linestring and could, possibly, differentiate between straight lines, regular turns, or random paths?
This paper makes mention of taking the sums of the delta in bearing for each vertex but I was wondering whether PostGIS has something built in that would make it easier.
There's no guarantee that any GPS track would be complete, cover a set time period, have the same length etcetc
Here are some examples of the GPS tracks: