The encoded polyline format for Google maps stores lat/lon information as well as zoom levels.
I have a huge text file with lat/lon pairs that i want to convert to this format and for different sections of polylines (i.e. i need to perform a batch conversion)
Does anyone know of a code that performs this operation ?
The definitive reference to encoding and decoding polylines is by Professor Mark McClure, at http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/
It contains utilities, a discussion of the algorithm and ports of the Javascript code into Perl, Ruby, PHP, Java and Mathematica.
Note: for Version 3, you don't need the levels
string which is needed for Version 2. Version 3 works out the levels for itself.