[−][src]Enum shapefile::record::Shape
enum of Shapes that can be read or written to a shapefile
geo-types
shapefile::Shape
and geo_types::Geometry<f64>
can be converted from one to another,
however this conversion is not infallible so it is done using TryFrom
use std::convert::TryFrom; use shapefile::Shape; let mut shapes = shapefile::read("tests/data/line.shp")?; let last_shape = shapes.pop().unwrap(); let geometry = geo_types::Geometry::<f64>::try_from(last_shape); assert_eq!(geometry.is_ok(), true); assert_eq!(geo_types::Geometry::<f64>::try_from(Shape::NullShape).is_err(), true);
Variants
Point(Point)
PointM(PointM)
PointZ(PointZ)
Polyline(Polyline)
PolylineM(PolylineM)
PolylineZ(PolylineZ)
Polygon(Polygon)
PolygonM(PolygonM)
PolygonZ(PolygonZ)
Multipoint(Multipoint)
MultipointM(MultipointM)
MultipointZ(MultipointZ)
Multipatch(Multipatch)
Implementations
impl Shape
[src]
Trait Implementations
impl Display for Shape
[src]
impl From<GenericMultipoint<Point>> for Shape
[src]
pub fn from(concrete: Multipoint) -> Self
[src]
impl From<GenericMultipoint<PointM>> for Shape
[src]
pub fn from(concrete: MultipointM) -> Self
[src]
impl From<GenericMultipoint<PointZ>> for Shape
[src]
pub fn from(concrete: MultipointZ) -> Self
[src]
impl From<GenericPolygon<Point>> for Shape
[src]
impl From<GenericPolygon<PointM>> for Shape
[src]
impl From<GenericPolygon<PointZ>> for Shape
[src]
impl From<GenericPolyline<Point>> for Shape
[src]
impl From<GenericPolyline<PointM>> for Shape
[src]
impl From<GenericPolyline<PointZ>> for Shape
[src]
impl From<Multipatch> for Shape
[src]
pub fn from(concrete: Multipatch) -> Self
[src]
impl From<Point> for Shape
[src]
impl From<PointM> for Shape
[src]
impl From<PointZ> for Shape
[src]
impl HasShapeType for Shape
[src]
impl ReadableShape for Shape
[src]
impl TryFrom<Geometry<f64>> for Shape
[src]
Converts a Geometry to a Shape
Since all Geometries are in 2D, the resulting shape will be 2D (Polygon, Polyline, etc and not PolylineM, PolylineZ, etc)
Fails if the geometry is a GeometryCollection, Rect, or Triangle
type Error = &'static str
The type returned in the event of a conversion error.
pub fn try_from(geometry: Geometry<f64>) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for Point
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for PointM
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for MultipointM
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for MultipointZ
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for Multipatch
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for PointZ
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for Polyline
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for PolylineM
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for PolylineZ
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for Polygon
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for PolygonM
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for PolygonZ
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(shape: Shape) -> Result<Self, Self::Error>
[src]
impl TryFrom<Shape> for Multipoint
[src]
Auto Trait Implementations
impl RefUnwindSafe for Shape
[src]
impl Send for Shape
[src]
impl Sync for Shape
[src]
impl Unpin for Shape
[src]
impl UnwindSafe for Shape
[src]
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,