I'm using the Polyline Encoder (PHP version) and I'm happy with the results, at least aesthetically. The problem I have is that the number of waypoints is so high, that even when encoded, it becomes a burden for both the server to encoder, and for Google Maps to render in the browser.
I was wondering, is anyone aware of an algorithm for reducing the complexity of a polyline (as it's expressed in so many hundreds of lat/ lng waypoints)? For example, given 100 waypoints describing a fairly round circle... $waypoints = array( array($lat,$lng), array($lat,$lng) ... ); $waypoints_out = downsample ($waypoints, .25); The resulting circle would contain a 25% of the original waypoints. Now I realize in this example it would be trivial simple to discard every second, third and fourth waypoint. But in other cases, the frequency of waypoints may change. The idea being, I want to preserve the integrity of the polyline as much as possible, while telling the algorithm to discard 75% of the waypoints. Or something like that. Any ideas? ...Rene --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
