Note that there are some explanatory texts on larger screens.

plurals
  1. POMerging multiple encoded polylines into one encoded polyline
    text
    copied!<p>I'm trying to merge a new encoded polyline with an existing polyline without decoding and reencoding the whole polyline. The new encoded polyline will be uploaded to a (linux) server where I would like to append it to the existing polyline.</p> <p>The problem is, you can't just mash them together. Below is some sample data to play with. My hope is to find/create a solution in either PHP or a shell script but the problem is, I have no where near enough technical understanding to interpret the encoded polyline algorithm. </p> <pre><code>41.386692,-73.475912 41.424822,-73.375027 41.428292,-73.311173 41.426183,-73.254577 41.470168,-73.218532 41.498865,-73.155278 (Yes, 6 points are easy, but it's going to be more like 7,000 coordinate pairs) </code></pre> <ul> <li>First 3 Coordinate Pairs Encoded: <code>yir{Fnwm_MimFquRuTanK</code></li> <li>Last 3: <code>s`z{Fbpb~L{qGg`FkrDkjK</code></li> <li>All 6: <code>yir{Fnwm_MimFquRuTanKdLw`J{qGg`FkrDkjK</code></li> </ul> <p><a href="http://code.google.com/apis/maps/documentation/utilities/polylineutility.html" rel="nofollow">Interactive Polyline Encoder Utility</a><br/> Encoded Polyline Algorithm Format (you can get to this via Interactive Encoder)<br/> <a href="http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/" rel="nofollow">Polyline Encoder</a><br/></p> <h1>Edit:</h1> <p>I also have the original data that encoded the polylines on both ends. So I can also save the first and last coordinate pair separately.</p> <h1>Helpful Reads:</h1> <p>I ended up writing a blog post that has a lot more detail about how encoded polylines work. You can read it here: <a href="http://www.danmandle.com/blog/what-is-an-encoded-polyline/" rel="nofollow">What is an Encoded Polyline?</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload