presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/JtsGeometrySerde.java/JtsGeometrySerde/writeGeometry
class JtsGeometrySerde:    private static void writeGeometry(Geometry geometry, DynamicSliceOutput output)
    {
        switch (geometry.getGeometryType()) {
            case "Point":
                writePoint((Point) geometry, output);
                break;
            case "MultiPoint":
                writeMultiPoint((MultiPoint) geometry, output);
                break;
            case "LineString":
                writePolyline(geometry, output, false);
                break;
            case "MultiLineString":
                writePolyline(geometry, output, true);
                break;
            case "Polygon":
                writePolygon(geometry, output, false);
                break;
            case "MultiPolygon":
                writePolygon(geometry, output, true);
                break;
            case "GeometryCollection":
                writeGeometryCollection(geometry, output);
                break;
            default:
                throw new IllegalArgumentException("Unsupported geometry type : " + geometry.getGeometryType());
        }
    }