[−][src]Struct shapefile::record::poly::GenericPolygon
Fields
bbox: BBox
points: Vec<PointType>
parts: Vec<i32>
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]
fn point<I: SliceIndex<[PointType]>>(
&self,
index: I
) -> Option<&<I as SliceIndex<[PointType]>>::Output>
[src]
&self,
index: I
) -> Option<&<I as SliceIndex<[PointType]>>::Output>
fn points(&self) -> &[PointType]
[src]
impl<PointType> MultipartShape<PointType> for GenericPolygon<PointType>
[src]
fn parts_indices(&self) -> &[i32]
[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]
ⓘImportant traits for PartIterator<'a, PointType, Shape>
Returns an iterator over the parts of a MultipartShape Read more
impl<PointType> From<GenericPolygon<PointType>> for GenericPolyline<PointType>
[src]
fn from(p: GenericPolygon<PointType>) -> Self
[src]
impl<PointType> From<GenericPolyline<PointType>> for GenericPolygon<PointType>
[src]
fn from(p: GenericPolyline<PointType>) -> Self
[src]
impl<PointType> From<Polygon<f64>> for GenericPolygon<PointType> where
PointType: HasXY + From<Coordinate<f64>>,
[src]
PointType: HasXY + From<Coordinate<f64>>,
geo_types guarantees that Polygons exterior and interiors are closed
impl<PointType> From<MultiPolygon<f64>> for GenericPolygon<PointType> where
PointType: HasXY + From<Coordinate<f64>>,
[src]
PointType: HasXY + From<Coordinate<f64>>,
fn from(multi_polygon: MultiPolygon<f64>) -> Self
[src]
impl From<GenericPolygon<Point>> for Shape
[src]
impl From<GenericPolygon<PointM>> for Shape
[src]
impl From<GenericPolygon<PointZ>> for Shape
[src]
impl<PointType> TryFrom<GenericPolygon<PointType>> for MultiPolygon<f64> where
PointType: HasXY + Copy,
Point<f64>: From<PointType>,
[src]
PointType: HasXY + Copy,
Point<f64>: From<PointType>,
Converts a shapefile polygon into a geo_types MultiPolygon
Because in a shapefile A Polygon may contain multiple outer rings
which are really just multiple polygons
Vertices of rings defining holes in polygons are in a counterclockwise direction
Auto Trait Implementations
impl<PointType> Sync for GenericPolygon<PointType> where
PointType: Sync,
PointType: Sync,
impl<PointType> Unpin for GenericPolygon<PointType> where
PointType: Unpin,
PointType: Unpin,
impl<PointType> Send for GenericPolygon<PointType> where
PointType: Send,
PointType: Send,
impl<PointType> UnwindSafe for GenericPolygon<PointType> where
PointType: UnwindSafe,
PointType: UnwindSafe,
impl<PointType> RefUnwindSafe for GenericPolygon<PointType> where
PointType: RefUnwindSafe,
PointType: RefUnwindSafe,
Blanket Implementations
impl<S> ReadableShape for S where
S: ConcreteReadableShape,
[src]
S: ConcreteReadableShape,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,