presto-geospatial/src/main/java/io/prestosql/plugin/geospatial/EncodedPolylineFunctions.java/EncodedPolylineFunctions/encode
class EncodedPolylineFunctions:    private static void encode(long value, DynamicSliceOutput output)
    {
        value = value < 0 ? ~(value << 1) : value << 1;
        while (value >= 0x20) {
            output.appendByte((byte) ((0x20 | (value & 0x1f)) + 63));
            value >>= 5;
        }
        output.appendByte((byte) (value + 63));
    }