Online CSV Polyline Encoder

The online CSV polyline encoder can be used to create encoded polylines by inputting points in CSV latitude and longitude format. This is useful when you need to encode a series of points with minimal space such as the Google Static Maps API where a URL can be used to define all parameters including a path. See this for more information.

How To Use

  1. Type in or copy/paste your points in the format...

    lat1,lng1

    lat2,lng2

    lat3,lng3

    .. i.e. lat/lng pairs separated by commas and each new point on a new line

  2. Click the Generate Button
  3. Wait for your encoded polyline to appear in red text below

Version History

Version 1 (16/09/2009)

  • Basic Conversion (may be buggy)

Version 1.1 (02/09/2010)

  • Added example Google Maps API static image URL

Version 1.2 (07/05/2014)

  • Some minor updates

References

Interactive Polyline Encoder Utility

Encoded Polyline Algorithm Format

Comments For This Page

funciono para mi, ramiro de argentina
By ramiro on 11th May 2015
Thanks Martin
By Daft Logic on 12th September 2014
My last comment: here I placed my utilities which can encode/decode points for Google Maps API. Hope it can be useful for someone as this page for me ;-)

http://maps.hlodoun.net/
By Martin on 12th September 2014
Hi,

thanks for LINK! You saved my day! This php script reduced 122974 points to 48660 and I can display my last trip now: ( http://uk2014.hlodoun.net/ )
By Martin on 11th September 2014
Hi, please find the PHP class here https://github.com/sminnee/silverstripe-gis/blob/master/thirdparty/PolylineEncoder.php
By Daft Logic on 10th September 2014
After some research it looks like that your algorithm do some kind of cleaning and removing some points. I personally like this - can you, please, share algorithm which points do you remove from encoded string?
By Martin on 10th September 2014
Hi,

thanks for great utility. I am trying to run encoding scrip for my project but unfortunately encoded string looks different. I use code from here: https://github.com/dyaaj/polyline-encoder/blob/master/PolylineEncoder.php

Any ideas why yours is shorter? Would it be possible to share your csv-polyline-encoder.php page please?

Thanks
By Martin on 10th September 2014
Hi, the preview now has a blue line.
By Daft Logic on 24th June 2014
Saved me a lot of time - thanks!

Can I suggest that line for the static image defaults to blue instead orange? It makes seeing it on a Google Map much easier :)
By Ali G on 22nd June 2014
thanks!
On 25th April 2014
This is great! Thanks!
By Jake N on 1st December 2012
Hi , tried to make it work , no success
By CHolt on 10th July 2010

Add your own comment below and let others know what you think:

Share This Page

Share this page with others using one of the methods below. Telling others about Daft Logic is good and we appreciate your support!