[−][src]Trait shapefile::record::traits::MultipointShape
Trait that allows access to the slice of points of shapes that have multiple points.
For convenience, even Point
, PointM
, PointZ
implements this trait
meaning that all shapes are MultipointShape
Required methods
fn point<I: SliceIndex<[PointType]>>(
&self,
index: I
) -> Option<&<I as SliceIndex<[PointType]>>::Output>
&self,
index: I
) -> Option<&<I as SliceIndex<[PointType]>>::Output>
fn points(&self) -> &[PointType]
Returns a non mutable slice to the points
Examples
use shapefile::record::{MultipointShape, Polyline}; let file_path = "tests/data/line.shp"; let polylines = shapefile::read_as::<&str, Polyline>(file_path).unwrap(); let first = &polylines[0]; for point in first.points() { println!("{}, {}", point.x, point.y); }
use shapefile::record::{MultipointShape, PolylineZ}; let file_path = "tests/data/linez.shp"; let polylines = shapefile::read_as::<&str, PolylineZ>(file_path).unwrap(); let first = &polylines[0]; for point in first.points() { println!("{} {} {}", point.x, point.y, point.z); }
Implementors
impl MultipointShape<Point> for Point
[src]
fn point<I: SliceIndex<[Point]>>(
&self,
index: I
) -> Option<&<I as SliceIndex<[Point]>>::Output>
[src]
&self,
index: I
) -> Option<&<I as SliceIndex<[Point]>>::Output>
fn points(&self) -> &[Point]
[src]
impl MultipointShape<PointM> for PointM
[src]
fn point<I: SliceIndex<[PointM]>>(
&self,
index: I
) -> Option<&<I as SliceIndex<[PointM]>>::Output>
[src]
&self,
index: I
) -> Option<&<I as SliceIndex<[PointM]>>::Output>
fn points(&self) -> &[PointM]
[src]
impl MultipointShape<PointZ> for Multipatch
[src]
fn point<I: SliceIndex<[PointZ]>>(
&self,
index: I
) -> Option<&<I as SliceIndex<[PointZ]>>::Output>
[src]
&self,
index: I
) -> Option<&<I as SliceIndex<[PointZ]>>::Output>
fn points(&self) -> &[PointZ]
[src]
impl MultipointShape<PointZ> for PointZ
[src]
fn point<I: SliceIndex<[PointZ]>>(
&self,
index: I
) -> Option<&<I as SliceIndex<[PointZ]>>::Output>
[src]
&self,
index: I
) -> Option<&<I as SliceIndex<[PointZ]>>::Output>
fn points(&self) -> &[PointZ]
[src]
impl<PointType> MultipointShape<PointType> for GenericMultipoint<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> 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> MultipointShape<PointType> for GenericPolyline<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>