Enum shapefile::record::Shape [−][src]
pub enum Shape {}Show variants
NullShape, 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),
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_shapes("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
Trait Implementations
impl From<GenericMultipoint<Point>> for Shape
[src]
impl From<GenericMultipoint<Point>> for Shape
[src]fn from(concrete: Multipoint) -> Self
[src]
impl From<GenericMultipoint<PointM>> for Shape
[src]
impl From<GenericMultipoint<PointM>> for Shape
[src]fn from(concrete: MultipointM) -> Self
[src]
impl From<GenericMultipoint<PointZ>> for Shape
[src]
impl From<GenericMultipoint<PointZ>> for Shape
[src]fn from(concrete: MultipointZ) -> Self
[src]
impl From<Multipatch> for Shape
[src]
impl From<Multipatch> for Shape
[src]fn from(concrete: Multipatch) -> Self
[src]
impl ReadableShape for Shape
[src]
impl ReadableShape for Shape
[src]impl TryFrom<Geometry<f64>> 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
impl TryFrom<Shape> for MultipointM
[src]
impl TryFrom<Shape> for MultipointM
[src]impl TryFrom<Shape> for MultipointZ
[src]
impl TryFrom<Shape> for MultipointZ
[src]impl TryFrom<Shape> for Multipatch
[src]
impl TryFrom<Shape> for Multipatch
[src]Auto Trait Implementations
impl RefUnwindSafe for Shape
impl RefUnwindSafe for Shape
impl UnwindSafe for Shape
impl UnwindSafe for Shape