presto-geospatial-toolkit/src/main/java/io/prestosql/geospatial/serde/GeometrySerde.java/GeometrySerde/writeGeometry
class GeometrySerde:    private static void writeGeometry(DynamicSliceOutput output, OGCGeometry geometry)
    {
        GeometryType type = GeometryType.getForEsriGeometryType(geometry.geometryType());
        switch (type) {
            case POINT:
                writePoint(output, geometry);
                break;
            case MULTI_POINT:
                writeSimpleGeometry(output, GeometrySerializationType.MULTI_POINT, geometry);
                break;
            case LINE_STRING:
                writeSimpleGeometry(output, GeometrySerializationType.LINE_STRING, geometry);
                break;
            case MULTI_LINE_STRING:
                writeSimpleGeometry(output, GeometrySerializationType.MULTI_LINE_STRING, geometry);
                break;
            case POLYGON:
                writeSimpleGeometry(output, GeometrySerializationType.POLYGON, geometry);
                break;
            case MULTI_POLYGON:
                writeSimpleGeometry(output, GeometrySerializationType.MULTI_POLYGON, geometry);
                break;
            case GEOMETRY_COLLECTION: {
                verify(geometry instanceof OGCConcreteGeometryCollection);
                writeGeometryCollection(output, (OGCConcreteGeometryCollection) geometry);
                break;
            }
            default:
                throw new IllegalArgumentException("Unexpected type: " + type);
        }
    }