diff --git a/src/geo_types_to_wkt.rs b/src/geo_types_to_wkt.rs index 10dd9ac..ea75ad6 100644 --- a/src/geo_types_to_wkt.rs +++ b/src/geo_types_to_wkt.rs @@ -1,6 +1,6 @@ use geo_types::CoordNum; -use crate::to_wkt::write_point; +use crate::to_wkt::{write_multi_polygon, write_point}; use crate::types::{ Coord, GeometryCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, @@ -188,6 +188,17 @@ where fn to_wkt(&self) -> Wkt { g_mpolygon_to_w_mpolygon(self).into() } + + fn wkt_string(&self) -> String { + let mut s = String::new(); + write_multi_polygon(&mut s, self).unwrap(); + s + } + + fn write_wkt(&self, writer: impl std::io::Write) -> std::io::Result<()> { + write_multi_polygon(&mut WriterWrapper(writer), self).unwrap(); + Ok(()) + } } /// # Examples