I’m reading the algorithm of google maps polyline encoding. I can’t understand step 8:
00001 11111 10000 01010 00010 00001
8. OR each value with 0x20 if another bit chunk follows:
100001 111111 110000 101010 100010 000001
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add a leading one to each value except the last one.
From step 7:
00001 11111 10000 01010 00010 00001Now read these as
000001 011111 010000 001010 000010 000001ORing with
0x20gives100001 111111 110000 101010 100010 000001which is what’s in step 8.
(The last one isn’t changed, because no “bit chunk” follows it.)