geo-svg
This crate is a lib to generate SVG strings from geo-types.
Below is an example of a geometry collection rendered to SVG.
Features
- GeometryCollection and all variants of Geometry are supported
- the viewport size is automatically computed to contain all shapes
- style and formatting options are available
Example
The following will show how to convert a line to a SVG string.
The to_svg
method is provided by the ToSvg
trait which is implemented for all geo-types.
use ;
use ;
let point = new;
let line = new;
let svg = point
.to_svg
.with_radius
.and
.with_fill_color
.with_stroke_color
.with_fill_opacity;
println!;
Result