[−][src]Struct shapefile::writer::Writer
struct that writes the shapes
Fields
dest: T
Implementations
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: &[S]) -> Result<(), Error>
[src]
Writes the shapes to the file
Examples
use shapefile::Point; let mut writer = shapefile::Writer::from_path("points.shp")?; 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)?;
use shapefile::{Point, Polyline}; let mut writer = shapefile::Writer::from_path("polylines.shp")?; 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); writer.write_shapes(&vec![polyline])?;
pub fn write_shapes_and_records<S: EsriShape>(
mut self: Self,
shapes: &[S],
records: Vec<Record>
) -> Result<(), Error>
[src]
mut self: Self,
shapes: &[S],
records: Vec<Record>
) -> Result<(), Error>
pub fn add_index_dest(&mut self, dest: T)
[src]
Adds dest as the destination where the index file will be written
pub fn add_dbase_dest(&mut self, dest: T)
[src]
Adds dest as the destination where the dbase content 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> RefUnwindSafe for Writer<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Writer<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Writer<T> where
T: Sync,
[src]
T: Sync,
impl<T> Unpin for Writer<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Writer<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,