[][src]Struct shapefile::writer::Writer

pub struct Writer<T: Write> {
    pub dest: T,
    // some fields omitted
}

struct that writes the shapes

Fields

dest: T

Methods

impl<T: Write> Writer<T>
[src]

pub fn new(dest: T) -> Self
[src]

Creates a writer that can be used to write a new shapefile.

The dest argument is only for the .shp

pub fn write_shapes<S: EsriShape>(
    &mut self,
    shapes: Vec<S>
) -> Result<(), Error>
[src]

Writes the shapes to the file

Examples

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();

pub fn add_index_dest(&mut self, dest: T)
[src]

Adds dest as the destination where the index file will be written

impl Writer<BufWriter<File>>
[src]

pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error>
[src]

Creates a new writer from a path. Creates both a .shp and .shx files

Examples

let writer = shapefile::Writer::from_path("/dev/null");

Auto Trait Implementations

impl<T> Send for Writer<T> where
    T: Send

impl<T> Sync for Writer<T> where
    T: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]