Re: [Gpsbabel-misc] extreme simplification
GPSBabel converts and transfers data like waypoints, tracks & routes.
Brought to you by:
robertl
|
From: Ron P. <ro...@pa...> - 2007-05-13 01:22:06
|
Vidar Gundersen wrote: > -x simplify,count=1 Last location > You might find that this is not consistently the case. There's nothing in the code that says it can't be the first location. Which one it is is essentially random. > What is the middle point? > Is it where half the distance was travelled, > or the halftime position? > Neither. It's not even easy to define what it is, in fact. In a sense, it's the point, not counting the endpoints, that made the single biggest contribution to the shape of the route. In reality, due to various assumptions inherent in the algorithm I use to simplify routes, it's not necessarily the very best point that could have been picked to represent the route, but it's probably somewhere close. As an example, say I have a route from Street Atlas that takes me from my home in Fort Wayne, Indiana to Toledo, Ohio. That route would follow Interstate 69 roughly north about 40 miles until it gets to Interstate 80, then follow Interstate 80 east about 80 miles to Toledo. The route, then, is roughly L-shaped, with 1/3 of the trip going north and the other 2/3 of the trip going east. It would consist of several hundred points, originally, but after simplification to three points, you'd probably find that the "middle" point was somewhere near the corner of the L. That's not halfway by distance or by time, but it's the most important point in the route. (In fact, I just checked and that's exactly what happens.) > Back to my above tracklog inventory: I'd like to > create a GPX file with one waypoint for each tracklog, > where the name of each waypoint is the file name of the > original tracklog (where the position should ideally be > a geometric average, but the endpoint is also useful). > I think your best bet is to try to compute the centroid yourself. The simplify filter won't be of much use in that endeavor, except perhaps to winnow the route down to a number of points that's more amenable to processing with Perl or Python. |