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
Missing features
- no style/formatting options are available
- the stroke width is fixed which might be very inadequate for various shape size
- the public API is not stable at all and is very susceptible to go through important breaking changes
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 most geo-types.
use ;
use ToSvg;
let point = new;
println!;
Result