#[cfg(feature = "gdal-lib")] mod gdal_examples { use gdal::Dataset; use geozero_core::gdal::process_geom; use geozero_core::svg::SvgWriter; use std::path::Path; #[test] fn ogr_to_svg() -> Result<(), gdal::errors::GdalError> { let mut dataset = Dataset::open(Path::new("tests/data/places.json"))?; let layer = dataset.layer(0)?; let mut out: Vec = Vec::new(); for feature in layer.features() { let geom = feature.geometry(); assert!(process_geom(&geom, &mut SvgWriter::new(&mut out, true)).is_ok()); } assert_eq!( &std::str::from_utf8(&out).unwrap()[..53], r#""# ); Ok(()) } }