presto-geospatial/src/main/java/io/prestosql/plugin/geospatial/EncodedPolylineFunctions.java/EncodedPolylineFunctions/toEncodedPolyline
class EncodedPolylineFunctions:    @Description("Encodes a linestring or multipoint geometry to a polyline")
    @ScalarFunction("to_encoded_polyline")
    @SqlType(StandardTypes.VARCHAR)
    public static Slice toEncodedPolyline(@SqlType(GEOMETRY_TYPE_NAME) Slice input)
    {
        OGCGeometry geometry = deserialize(input);
        validateType("encode_polyline", geometry, EnumSet.of(LINE_STRING, MULTI_POINT));
        GeometryType geometryType = GeometryType.getForEsriGeometryType(geometry.geometryType());
        switch (geometryType) {
            case LINE_STRING:
            case MULTI_POINT:
                return encodePolyline((MultiVertexGeometry) geometry.getEsriGeometry());
            default:
                throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Unexpected geometry type: " + geometryType);
        }
    }