Struct geozero_shp::reader::Reader [−][src]
struct that reads the content of a shapefile
Implementations
impl<T: Read> Reader<T>
[src]
pub fn new(source: T) -> Result<Reader<T>, Error>
[src]
Creates a new Reader from a source that implements the Read
trait
The Shapefile header is read upon creation (but no reading of the Shapes is done)
Errors
Will forward any std::io::Error
Will also return an error if the data is not a shapefile (Wrong file code)
Will also return an error if the shapetype read from the input source is invalid
pub fn header(&self) -> &Header
[src]
Returns a non-mutable reference to the header read
pub fn read_records(self) -> Result<Vec<Record>, Error>
[src]
Read and return only the records contained in the .dbf file
pub fn iter_geometries<P: FeatureProcessor>(
self,
processor: P
) -> ShapeIterator<P, T>ⓘNotable traits for ShapeIterator<P, T>
impl<P: GeomProcessor, T: Read> Iterator for ShapeIterator<P, T> type Item = Result<(), Error>;
[src]
self,
processor: P
) -> ShapeIterator<P, T>ⓘ
Notable traits for ShapeIterator<P, T>
impl<P: GeomProcessor, T: Read> Iterator for ShapeIterator<P, T> type Item = Result<(), Error>;
pub fn iter_features<P: FeatureProcessor>(
self,
processor: P
) -> Result<ShapeRecordIterator<P, T>, Error>
[src]
self,
processor: P
) -> Result<ShapeRecordIterator<P, T>, Error>
Returns an iterator over the Shapes and their Records
Errors
The Result
will be an error if the .dbf wasn’t found
pub fn add_index_source(&mut self, source: T) -> Result<(), Error>
[src]
Reads the index file from the source This allows to later read shapes by giving their index without reading the whole file
(see read_nth_shape())
pub fn add_dbf_source(&mut self, source: T) -> Result<(), Error>
[src]
Adds the source
as the source where the dbf record will be read from
impl Reader<BufReader<File>>
[src]
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self, Error>
[src]
Creates a reader from a path to a file
Will attempt to read both the .shx and .dbf associated with the file, if they do not exists the function will not fail, and you will get an error later if you try to use a function that requires the file to be present.
Auto Trait Implementations
impl<T> RefUnwindSafe for Reader<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Reader<T> where
T: Send,
T: Send,
impl<T> Sync for Reader<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Reader<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Reader<T> where
T: UnwindSafe,
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>,