3

I am currently writing an application which displays saved gps paths on a map. (I am using greatmaps for the map) Link

I am looking to run some path smoothing and point reducing algorithm on the path to produce a cleaner looking path on the map. I have been looking at the Ramer–Douglas–Peucker algorithm and possibly a spline.

Can anyone advise me on what approach to take, Any help on this issue would be great.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Daniel Flannery
  • 1,166
  • 8
  • 23
  • 51
  • Note- I may have found an approach in the following question: http://stackoverflow.com/questions/7980586/how-to-reduce-the-number-of-points-in-a-curve-while-preserving-its-overall-shape – Daniel Flannery Mar 16 '13 at 14:48
  • How many points are we talking about? I've found a simple moving average calc can be done quickly and not mess things up. And reading your referenced question, that one is clearly the best approach. – user7116 Mar 16 '13 at 15:17
  • The number of points can vary depending on the length the user was recording gps location. – Daniel Flannery Mar 16 '13 at 15:31

1 Answers1

2

The algorithm key part is to recursion. If you could understand how it works,disregard of language it is the same thing. So,basically we just have to take points and send them to a function that holds the logic(which also does the recursion) part.

As you have the implementation now,pick up the points from the control as this.MainMap.Position (play with the control to know about ) , and call that implemented function :)

This might give you a start

Good luck!

Yash
  • 177
  • 2
  • 14
  • Im currently looking at this implementation. I am looking for advice on whether this is an appropriate approach to take. – Daniel Flannery Mar 16 '13 at 14:45
  • I guess you are on the right path. you could use `this.MainMap.Markers[0].Position` to get points,run this algo and update it – Yash Mar 16 '13 at 14:59
  • When answering a question by providing links to an external source of information, always include the important parts of information from that source in your answer, as links might die over time. – Lukas Knuth Mar 16 '13 at 15:07