সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
পলিলাইন এনকোডিং হল একটি ক্ষতিকর কম্প্রেশন অ্যালগরিদম যা আপনাকে একক স্ট্রিং হিসাবে একাধিক স্থানাঙ্ক সংরক্ষণ করতে দেয়। পয়েন্ট স্থানাঙ্ক স্বাক্ষরিত মান ব্যবহার করে এনকোড করা হয়। আপনার যদি শুধুমাত্র কয়েকটি স্ট্যাটিক পয়েন্ট থাকে, তাহলে আপনি ইন্টারেক্টিভ পলিলাইন এনকোডিং ইউটিলিটি ব্যবহার করতে চাইতে পারেন।
এনকোডিং প্রক্রিয়া পরিচিত বেস64 এনকোডিং স্কিম ব্যবহার করে ASCII অক্ষরগুলির জন্য একটি বাইনারি মানকে ক্যারেক্টার কোডের একটি সিরিজে রূপান্তর করে: এই অক্ষরগুলির সঠিক প্রদর্শন নিশ্চিত করতে, এনকোড করা মানগুলিকে ASCII তে রূপান্তর করার আগে 63 (ASCII অক্ষর '?') দিয়ে যোগ করা হয়। . অ্যালগরিদম প্রতিটি বাইট গ্রুপের সর্বনিম্ন উল্লেখযোগ্য বিট চেক করে একটি নির্দিষ্ট পয়েন্টের জন্য অতিরিক্ত অক্ষর কোডগুলিও পরীক্ষা করে; যদি এই বিটটি 1 এ সেট করা থাকে, বিন্দুটি এখনও সম্পূর্ণরূপে গঠিত হয়নি এবং অতিরিক্ত ডেটা অবশ্যই অনুসরণ করতে হবে।
অতিরিক্তভাবে, স্থান সংরক্ষণ করার জন্য, পয়েন্টগুলি শুধুমাত্র পূর্ববর্তী বিন্দু থেকে অফসেট অন্তর্ভুক্ত করে (অবশ্যই প্রথম পয়েন্টের জন্য ছাড়া)। সমস্ত পয়েন্ট বেস64-এ স্বাক্ষরিত পূর্ণসংখ্যা হিসাবে এনকোড করা হয়েছে, কারণ অক্ষাংশ এবং দ্রাঘিমাংশগুলি স্বাক্ষরিত মান। একটি পলিলাইনের মধ্যে এনকোডিং বিন্যাসকে যুক্তিসঙ্গত নির্ভুলতার জন্য অক্ষাংশ এবং দ্রাঘিমাংশের প্রতিনিধিত্বকারী দুটি স্থানাঙ্ক উপস্থাপন করতে হবে। সর্বোচ্চ দ্রাঘিমাংশে +/- 180 ডিগ্রি 5 দশমিক স্থানের নির্ভুলতা (180.00000 থেকে -180.00000) দেওয়া হলে, এর ফলে একটি 32 বিট স্বাক্ষরিত বাইনারি পূর্ণসংখ্যা মানের প্রয়োজন হয়।
মনে রাখবেন যে ব্যাকস্ল্যাশকে স্ট্রিং লিটারেলের মধ্যে একটি এস্কেপ ক্যারেক্টার হিসেবে ব্যাখ্যা করা হয়েছে। এই ইউটিলিটির যেকোনো আউটপুট ব্যাকস্ল্যাশ অক্ষরকে স্ট্রিং লিটারেলের মধ্যে ডবল-ব্যাকস্ল্যাশে রূপান্তর করতে হবে।
এই ধরনের একটি স্বাক্ষরিত মান এনকোডিংয়ের জন্য ধাপগুলি নীচে উল্লেখ করা হয়েছে৷
প্রাথমিক স্বাক্ষরিত মান নিন: -179.9832104
দশমিক মান নিন এবং ফলাফলটিকে বৃত্তাকার করে 1e5 দ্বারা গুণ করুন: -17998321
দশমিক মানকে বাইনারিতে রূপান্তর করুন। মনে রাখবেন যে একটি ঋণাত্মক মান অবশ্যই তার দুটির পরিপূরক ব্যবহার করে বাইনারি মানকে উল্টে এবং ফলাফলে একটি যোগ করে গণনা করতে হবে:
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-22 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003ePolyline encoding is a lossy compression algorithm that represents a series of coordinates as a single string.\u003c/p\u003e\n"],["\u003cp\u003eThe algorithm uses signed values, Base64 encoding, and offsets from the previous point to compress the data.\u003c/p\u003e\n"],["\u003cp\u003ePoints are encoded by converting latitude and longitude to binary, applying bitwise operations, and converting the result to ASCII characters.\u003c/p\u003e\n"],["\u003cp\u003eEncoded polylines are strings that consist of these ASCII characters, representing the sequence of geographical points.\u003c/p\u003e\n"]]],["Polyline encoding compresses coordinates into a single string. It encodes points as signed integers representing offsets from the previous point. The process involves multiplying the decimal by 1e5, converting to binary (using two's complement for negative values), left-shifting, inverting if negative, dividing into 5-bit chunks, reversing chunk order, OR-ing with 0x20, adding 63, and converting to ASCII. Points are represented in Base64 and latitude/longitude are paired, encoded sequentially. The result is a compact string representing the sequence of points.\n"],null,["Polyline encoding is a lossy compression algorithm that allows you to store a series of\ncoordinates as a single string. Point coordinates are encoded using signed values.\nIf you only have a few static points, you may also wish to use the interactive\n[polyline encoding utility](/maps/documentation/utilities/polylineutility).\n\nThe encoding process converts a binary value into a series of character codes for\nASCII characters using the familiar base64 encoding scheme: to ensure proper display\nof these characters, encoded values are summed with 63 (the ASCII character '?')\nbefore converting them into ASCII. The algorithm also checks for additional\ncharacter codes for a given point by checking the least significant bit of each\nbyte group; if this bit is set to 1, the point is not yet fully formed and\nadditional data must follow.\n\nAdditionally, to conserve space, **points only include the offset from the\nprevious point** (except of course for the first point). All points are encoded\nin Base64 as signed integers, as latitudes and longitudes are signed values.\nThe encoding format within a polyline needs to represent two coordinates\nrepresenting latitude and longitude to a reasonable precision. Given a maximum\nlongitude of +/- 180 degrees to a precision of 5 decimal places\n(180.00000 to -180.00000), this results in the need for a 32 bit signed\nbinary integer value.\n\nNote that the backslash is interpreted as an escape character within string literals. Any output of this utility should convert backslash\ncharacters to double-backslashes within string literals.\n\nThe steps for encoding such a signed value are specified below.\n\n1. Take the initial signed value: \n `-179.9832104`\n2. Take the decimal value and multiply it by 1e5, rounding the result: \n `-17998321`\n3. Convert the decimal value to binary. Note that a negative value must be calculated using its [two's complement](https://en.wikipedia.org/wiki/Two%27s_complement) by inverting the binary value and adding one to the result: \n\n ```\n 00000001 00010010 10100001 11110001\n 11111110 11101101 01011110 00001110\n 11111110 11101101 01011110 00001111\n ```\n4. Left-shift the binary value one bit: \n `11111101 11011010 10111100 00011110`\n5. If the original decimal value is negative, invert this encoding: \n `00000010 00100101 01000011 11100001`\n6. Break the binary value out into 5-bit chunks (starting from the right hand side): \n `00001 00010 01010 10000 11111 00001`\n7. Place the 5-bit chunks into reverse order: \n `00001 11111 10000 01010 00010 00001`\n8. OR each value with 0x20 if another bit chunk follows: \n `100001 111111 110000 101010 100010 000001`\n9. Convert each value to decimal: \n `33 63 48 42 34 1`\n10. Add 63 to each value: \n `96 126 111 105 97 64`\n11. Convert each value to its ASCII equivalent: \n ```~oia@``\n\nThe table below shows some examples of encoded points, showing the\nencodings as a series of offsets from previous points. \n\nExample \nPoints: (38.5, -120.2), (40.7, -120.95), (43.252, -126.453)\n\n|----------|-----------|----------------|-----------------|--------------------|---------------------|------------------|-------------------|---------------|\n| Latitude | Longitude | Latitude in E5 | Longitude in E5 | Change In Latitude | Change In Longitude | Encoded Latitude | Encoded Longitude | Encoded Point |\n| 38.5 | -120.2 | 3850000 | -12020000 | +3850000 | -12020000 | `_p~iF` | `~ps|U` | `_p~iF~ps|U` |\n| 40.7 | -120.95 | 4070000 | -12095000 | +220000 | -75000 | `_ulL` | `nnqC` | `_ulLnnqC` |\n| 43.252 | -126.453 | 4325200 | -12645300 | +255200 | -550300 | `_mqN` | ``vxq`@`` | ``_mqNvxq`@`` |\n\n**Encoded polyline** : ``_p~iF~ps|U_ulLnnqC_mqNvxq`@``"]]