Encoding Google Maps Polylines - MATLAB Cody - MATLAB Central

Problem 569. Encoding Google Maps Polylines

Difficulty:Rate

This problem is based on the Google Polyline Encoder algorithm. This is how Google Maps encodes a line for display on a map. You will be given a single latitude-longitude pair for which you must generate the encoded string used by the Google Maps API.

Example:

Given

 lat = 42.3 
 lon = -71.35

then

 str = '_vdaGnpnrL'

Here is the complete algorithm description. You can use this interactive tool to play around with it (I used it to generate the test points).

Solution Stats

58.82% Correct | 41.18% Incorrect
Last Solution submitted on Mar 28, 2023

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...
Dive Into Hands-On Learning at MATLAB EXPO 2025 – Register Now!
Get ready to roll up your sleeves at MATLAB EXPO 2025 –...
0

Problem Recent Solvers13

Suggested Problems

More from this Author50

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!