presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/readGeometry
class JtsGeometrySerde:    private static Geometry readGeometry(BasicSliceInput input, GeometrySerializationType type)
    {
        switch (type) {
            case POINT:
                return readPoint(input);
            case MULTI_POINT:
                return readMultiPoint(input);
            case LINE_STRING:
                return readPolyline(input, false);
            case MULTI_LINE_STRING:
                return readPolyline(input, true);
            case POLYGON:
                return readPolygon(input, false);
            case MULTI_POLYGON:
                return readPolygon(input, true);
            case GEOMETRY_COLLECTION:
                return readGeometryCollection(input);
            case ENVELOPE:
                return readEnvelope(input);
            default:
                throw new UnsupportedOperationException("Unexpected type: " + type);
        }
    }