presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readPolyline
class JtsGeometrySerde:    private static Geometry readPolyline(SliceInput input, boolean multitype)
    {
        skipEsriType(input);
        skipEnvelope(input);
        int partCount = input.readInt();
        if (partCount == 0) {
            if (multitype) {
                return GEOMETRY_FACTORY.createMultiLineString();
            }
            return GEOMETRY_FACTORY.createLineString();
        }

        int pointCount = input.readInt();
        int[] startIndexes = new int[partCount];
        for (int i = 0; i < partCount; i++) {
            startIndexes[i] = input.readInt();
        }

        int[] partLengths = new int[partCount];
        if (partCount > 1) {
            partLengths[0] = startIndexes[1];
            for (int i = 1; i < partCount - 1; i++) {
                partLengths[i] = startIndexes[i + 1] - startIndexes[i];
            }
        }
        partLengths[partCount - 1] = pointCount - startIndexes[partCount - 1];

        LineString[] lineStrings = new LineString[partCount];

        for (int i = 0; i < partCount; i++) {
            lineStrings[i] = GEOMETRY_FACTORY.createLineString(readCoordinates(input, partLengths[i]));
        }

        if (multitype) {
            return GEOMETRY_FACTORY.createMultiLineString(lineStrings);
        }
        verify(lineStrings.length == 1);
        return lineStrings[0];
    }