Skip to content

Commit

Permalink
wrap multi polygon too
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Nov 26, 2024
1 parent 29c4e45 commit 9b8ca1a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/geo_types_to_wkt.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -188,6 +188,17 @@ where
fn to_wkt(&self) -> Wkt<T> {
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
Expand Down

0 comments on commit 9b8ca1a

Please sign in to comment.