[][src]Struct shapefile::record::poly::GenericPolygon

pub struct GenericPolygon<PointType> {
    pub bbox: BBox,
    // some fields omitted
}

Fields

bbox: BBox

Methods

impl<PointType: HasXY> GenericPolygon<PointType>
[src]

pub fn new(points: Vec<PointType>, parts: Vec<i32>) -> Self
[src]

Examples

Creating a PolygonZ

use shapefile::{PointZ, PolygonZ, NO_DATA, MultipointShape};
let points = vec![
    PointZ::new(1.0, 1.0, 0.0, NO_DATA),
    PointZ::new(2.0, 2.0, 17.0, NO_DATA),
];
let poly = PolygonZ::new(points, vec![0]);

assert_eq!(poly.point(1), Some(&PointZ::new(2.0, 2.0, 17.0, NO_DATA)));

Trait Implementations

impl<PointType> MultipointShape<PointType> for GenericPolygon<PointType>
[src]

impl<PointType> MultipartShape<PointType> for GenericPolygon<PointType>
[src]

fn part(&self, index: usize) -> Option<&[PointType]>
[src]

Returns the slice of points corresponding to part n°ìndex if the shape actually has multiple parts Read more

Important traits for PartIterator<'a, PointType, Shape>
fn parts(&self) -> PartIterator<PointType, Self>
[src]

Returns an iterator over the parts of a MultipartShape Read more

impl<PointType> From<GenericPolygon<PointType>> for GenericPolyline<PointType>
[src]

impl<PointType> From<GenericPolyline<PointType>> for GenericPolygon<PointType>
[src]

impl From<GenericPolygon<Point>> for Shape
[src]

impl From<GenericPolygon<PointM>> for Shape
[src]

impl From<GenericPolygon<PointZ>> for Shape
[src]

Auto Trait Implementations

impl<PointType> Send for GenericPolygon<PointType> where
    PointType: Send

impl<PointType> Sync for GenericPolygon<PointType> where
    PointType: Sync

Blanket Implementations

impl<S> ReadableShape for S where
    S: ConcreteReadableShape
[src]

type ReadShape = <S as ConcreteShape>::ActualShape

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]