Function shapefile::reader::read_shapes
source · pub fn read_shapes<T: AsRef<Path>>(path: T) -> Result<Vec<Shape>, Error>
Expand description
Function to read all the Shapes in a file.
Returns a Vec<Shape>
which means that you will have to match
the individual Shape contained inside the Vec
to get the actual struct
Useful if you don’t know in advance (at compile time) which kind of shape the file contains
Examples
let shapes = shapefile::read_shapes("tests/data/multipatch.shp")?;
assert_eq!(shapes.len(), 1);