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.
lat1,lng1
lat2,lng2
lat3,lng3
.. i.e. lat/lng pairs separated by commas and each new point on a new line
Version | Date | Changes |
---|---|---|
1 | 16th September 2019 | Basic Conversion (may be buggy) |
1.1 | 2nd September 2010 | Added example Google Maps API static image URL |
1.2 | 7th May 2014 | Some minor updates |
1.3 | 5th May 2020 | Added placeholder text to text area |
Interactive Polyline Encoder Utility
Encoded Polyline Algorithm Format
Hi R, When you say no luck, what do you mean? Are you able to provide the data you input? <br />
or, a cut down version?
No luck, Google is asking for an encoding to use maps.
By R on 16th February 2021Does the algorithm take distance between points into account?
I pasted a polygon path generated from an arcgis shapefile which had > 1000 points and the encoded line i get back only has about 10%, ~122 points, in it.
It is designed to input a list of lat,lng values and export a single polyline. It does not support MultiPolygons
By Daft Logic on 4th May 2020Greta tool. I use it regularly.
I have one problem. How do I encode a "MultiPolygon".
It doesnt work if I flatten it.
This is freaking amazing! Helped me a lot with testing map
On 3rd October 2019funciono para mi, ramiro de argentina
By ramiro on 11th May 2015Thanks Martin
By Daft Logic on 12th September 2014My 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/
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/ )
Hi, please find the PHP class here https://github.com/sminnee/silverstripe-gis/blob/master/thirdparty/PolylineEncoder.php
By Daft Logic on 10th September 2014After 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 2014Hi,
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
Hi, the preview now has a blue line.
By Daft Logic on 24th June 2014Saved 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 :)
thanks!
On 25th April 2014This is great! Thanks!
By Jake N on 1st December 2012Hi , tried to make it work , no success
By CHolt on 10th July 2010There's no need to create an account or provide unnecessary details. Just your comment.