pub struct Writer<T: Write> {
pub dest: T,
// some fields omitted
}
struct that writes the shapes
Creates a writer that can be used to write a new shapefile.
The dest
argument is only for the .shp
Writes the shapes to the file
use shapefile::Point;
let mut writer = shapefile::Writer::from_path("points.shp").unwrap();
let points = vec![Point::new(0.0, 0.0), Point::new(1.0, 0.0), Point::new(2.0, 0.0)];
writer.write_shapes(points).unwrap();
use shapefile::{Point, Polyline};
let mut writer = shapefile::Writer::from_path("polylines.shp").unwrap();
let points = vec![Point::new(0.0, 0.0), Point::new(1.0, 0.0), Point::new(2.0, 0.0)];
let polyline = Polyline::new(points, vec![0]);
writer.write_shapes(vec![polyline]).unwrap();
Adds dest as the destination where the index file will be written
Creates a new writer from a path.
Creates both a .shp and .shx files
let writer = shapefile::Writer::from_path("/dev/null");
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static