presto-geospatial/src/main/java/io/prestosql/plugin/geospatial/EncodedPolylineFunctions.java/EncodedPolylineFunctions/decodePolyline
class EncodedPolylineFunctions:    private static OGCLineString decodePolyline(String polyline)
    {
        MultiPath multipath = new Polyline();
        boolean isFirstPoint = true;

        int index = 0;
        int latitude = 0;
        int longitude = 0;

        while (index < polyline.length()) {
            int result = 1;
            int shift = 0;
            int bytes;
            do {
                bytes = polyline.charAt(index++) - 63 - 1;
                result += bytes << shift;
                shift += 5;
            } while (bytes >= 0x1f);
            latitude += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);

            result = 1;
            shift = 0;
            do {
                bytes = polyline.charAt(index++) - 63 - 1;
                result += bytes << shift;
                shift += 5;
            } while (bytes >= 0x1f);
            longitude += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);

            if (isFirstPoint) {
                multipath.startPath(longitude * 1e-5, latitude * 1e-5);
                isFirstPoint = false;
            }
            else {
                multipath.lineTo(longitude * 1e-5, latitude * 1e-5);
            }
        }

        return new OGCLineString(multipath, 0, null);
    }