[][src]Struct shapefile::record::multipatch::Multipatch

pub struct Multipatch {
    pub bbox: BBox,
    pub points: Vec<PointZ>,
    pub parts: Vec<i32>,
    pub parts_type: Vec<PatchType>,
    pub z_range: [f64; 2],
    pub m_range: [f64; 2],
}

Following things are important with Multipatch shape:

  1. Ring types must be closed
  2. InnerRings must follow their OuterRings
  3. Parts must not intersects or penetrate each others

Fields

bbox: BBoxpoints: Vec<PointZ>parts: Vec<i32>parts_type: Vec<PatchType>z_range: [f64; 2]m_range: [f64; 2]

Methods

impl Multipatch[src]

pub fn new(points: Vec<PointZ>, part_type: PatchType) -> Self[src]

Examples

Creating a Multipatch with one outer ring, The constructor closes rings

use shapefile::{PointZ, Multipatch, NO_DATA, PatchType};
let points = vec![
    PointZ::new(0.0, 0.0, 0.0, NO_DATA),
    PointZ::new(0.0, 1.0, 0.0, NO_DATA),
    PointZ::new(1.0, 0.0, 0.0, NO_DATA),
];
let multip = Multipatch::new(points, PatchType::OuterRing);

// The polygon gets closed 'explicitly'
assert_eq!(multip.points.len(), 4);
assert_eq!(multip.points.last(), multip.points.first());

pub fn with_parts(parts_points: Vec<(Vec<PointZ>, PatchType)>) -> Self[src]

pub fn empty() -> Self[src]

Trait Implementations

impl Clone for Multipatch[src]

impl ConcreteReadableShape for Multipatch[src]

impl ConcreteShape for Multipatch[src]

impl Debug for Multipatch[src]

impl Display for Multipatch[src]

impl EsriShape for Multipatch[src]

impl From<MultiPolygon<f64>> for Multipatch[src]

impl From<Multipatch> for Shape[src]

impl From<Polygon<f64>> for Multipatch[src]

impl HasShapeType for Multipatch[src]

impl MultipartShape<PointZ> for Multipatch[src]

impl MultipointShape<PointZ> for Multipatch[src]

impl PartialEq<Multipatch> for Multipatch[src]

impl StructuralPartialEq for Multipatch[src]

impl TryFrom<Multipatch> for MultiPolygon<f64>[src]

Converts a Multipatch to Multipolygon

For simplicity,reasons, Triangle Fan & Triangle Strip are considered to be valid polygons When the individual types of rings in a collection of rings representing a polygonal patch with holes are unknown, the sequence must start with First Ring, followed by a number of Rings. A sequence of Rings not preceded by an First Ring is treated as a sequence of Outer Rings without holes.

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Shape> for Multipatch[src]

type Error = Error

The type returned in the event of a conversion error.

impl WritableShape for Multipatch[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.