I have an Android/Java app that continually plots your locations and draws lines connecting sequential points, so I get the route that I have taken on a map. The route will be continuously drawn, as the same path is continually repeated, so that it looks like some type of closed polygon.

Right now it looks like a bunch of "spaghetti" routes and I need to be able to average out the haul route so that if I have 20 cycles, instead of 20 separate haul routes, I want one haul route that is the average of all 20 routes. Mathematically it seems I need some type of library that performs a least squares regression/ polygon fitting model to get what I want. Or I need to way to grid my route and take the best fitting curve in each sub-plot section.

Just wondering if anyone knows of any libraries like this or if Google provides something like this in its API? Hoping maybe there is a simple solution that I'm not aware of that visually picks up on the neighboring points. I could potentially get vector heading if need be.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.