Trait geozero::ToSvg[][src]

pub trait ToSvg {
    fn to_svg(&self) -> Result<String>;
fn to_svg_document(&self) -> Result<String>; }
Expand description

Convert to SVG.

Usage example:

Convert a geo-types Polygon to an SVG document:

use geozero::ToSvg;
use geo_types::polygon;

let geom: geo_types::Geometry<f64> = polygon![
    (x: 220., y: 10.),
    (x: 300., y: 210.),
    (x: 170., y: 250.),
    (x: 123., y: 234.),
]
.into();

println!("{}", &geom.to_svg_document().unwrap());

Required methods

Convert to SVG geometry.

Convert to SVG document.

Implementors