Problem 569. Encoding Google Maps Polylines
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
Problem Comments
-
1 Comment
Ned,
I suggest creating a random lat and long test case. Use the bmtran entry#3 to solve for the correct vector. Once the test suite is updated it is possible to re-score.
Solution Comments
Show commentsProblem Recent Solvers13
Suggested Problems
-
22147 Solvers
-
Calculate the Levenshtein distance between two strings
1360 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3014 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1036 Solvers
-
Split a string into chunks of specified length
1552 Solvers
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!