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 Button
  3. Wait for your encoded polyline to appear in red text below

Version History

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

References

Interactive Polyline Encoder Utility

Encoded Polyline Algorithm Format

Comments For This Page

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?

By Daft Logic on 18th February 2021

No luck, Google is asking for an encoding to use maps.

By R on 16th February 2021

Does 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.

By Martin on 2nd June 2020

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 2020

Greta tool. I use it regularly.
I have one problem. How do I encode a "MultiPolygon".
It doesnt work if I flatten it.

By Vivie on 4th May 2020

This is freaking amazing! Helped me a lot with testing map

On 3rd October 2019

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 Comment

There's no need to create an account or provide unnecessary details. Just your comment.