Open michaelkirk opened 2 years ago
Currently geo-types uses the default implementation of wkt_string
wkt_string
fn wkt_string(&self) -> String { self .to_wkt() // <-- this allocates a Wkt struct .to_string() }
Instead we could write an individual implementation for each geometry type that doesn't rely on first converting to a Wkt struct. e.g.
Wkt
impl ToWkt for geo_types::Point { ... fn wkt_string(&self) -> String { format!("POINT({} {})", self.x, self.y) } }
There might be better and worse ways to do this WRT code re-use of the existing serialization methods on Wkt.
Currently geo-types uses the default implementation of
wkt_string
Instead we could write an individual implementation for each geometry type that doesn't rely on first converting to a
Wkt
struct. e.g.There might be better and worse ways to do this WRT code re-use of the existing serialization methods on
Wkt
.