pub struct LineString<T: WktNum = f64> { /* private fields */ }Expand description
A parsed LineString.
Implementations§
Source§impl<T: WktNum> LineString<T>
impl<T: WktNum> LineString<T>
Sourcepub fn from_coords(coords: impl IntoIterator<Item = Coord<T>>) -> Option<Self>
pub fn from_coords(coords: impl IntoIterator<Item = Coord<T>>) -> Option<Self>
Create a new LineString from a non-empty sequence of Coord.
This will infer the dimension from the first coordinate, and will not validate that all coordinates have the same dimension.
Returns None if the input iterator is empty.
To handle empty input iterators, consider calling unwrap_or on the result and defaulting
to an empty geometry with specified dimension.
Sourcepub fn into_inner(self) -> (Vec<Coord<T>>, Dimension)
pub fn into_inner(self) -> (Vec<Coord<T>>, Dimension)
Consume self and return the inner parts.
Trait Implementations§
Source§impl<T: Clone + WktNum> Clone for LineString<T>
impl<T: Clone + WktNum> Clone for LineString<T>
Source§fn clone(&self) -> LineString<T>
fn clone(&self) -> LineString<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Default + WktNum> Default for LineString<T>
impl<T: Default + WktNum> Default for LineString<T>
Source§fn default() -> LineString<T>
fn default() -> LineString<T>
Returns the “default value” for a type. Read more
Source§impl<T> Display for LineString<T>
impl<T> Display for LineString<T>
Source§impl<'a, T> From<&'a LineString<T>> for Geometry<T>where
T: CoordNum,
Available on crate feature geo-types only.
impl<'a, T> From<&'a LineString<T>> for Geometry<T>where
T: CoordNum,
Available on crate feature
geo-types only.Source§fn from(line_string: &'a LineString<T>) -> Self
fn from(line_string: &'a LineString<T>) -> Self
Converts to this type from the input type.
Source§impl<T> From<LineString<T>> for LineString<T>where
T: CoordNum,
Available on crate feature geo-types only.
impl<T> From<LineString<T>> for LineString<T>where
T: CoordNum,
Available on crate feature
geo-types only.Source§fn from(line_string: LineString<T>) -> Self
fn from(line_string: LineString<T>) -> Self
Convert from a WKT LINESTRING to a geo_types::LineString
Source§impl<T> From<LineString<T>> for Wkt<T>where
T: WktNum,
impl<T> From<LineString<T>> for Wkt<T>where
T: WktNum,
Source§fn from(value: LineString<T>) -> Self
fn from(value: LineString<T>) -> Self
Converts to this type from the input type.
Source§impl<'a, T: WktNum + 'a> GeometryTrait for &'a LineString<T>
impl<'a, T: WktNum + 'a> GeometryTrait for &'a LineString<T>
Source§type PointType<'b> = Point<<&'a LineString<T> as GeometryTrait>::T>
where
Self: 'b
type PointType<'b> = Point<<&'a LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying Point, which implements PointTrait
Source§type LineStringType<'b> = LineString<<&'a LineString<T> as GeometryTrait>::T>
where
Self: 'b
type LineStringType<'b> = LineString<<&'a LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying LineString, which implements LineStringTrait
Source§type PolygonType<'b> = Polygon<<&'a LineString<T> as GeometryTrait>::T>
where
Self: 'b
type PolygonType<'b> = Polygon<<&'a LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying Polygon, which implements PolygonTrait
Source§type MultiPointType<'b> = MultiPoint<<&'a LineString<T> as GeometryTrait>::T>
where
Self: 'b
type MultiPointType<'b> = MultiPoint<<&'a LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying MultiPoint, which implements MultiPointTrait
Source§type MultiLineStringType<'b> = MultiLineString<<&'a LineString<T> as GeometryTrait>::T>
where
Self: 'b
type MultiLineStringType<'b> = MultiLineString<<&'a LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying MultiLineString, which implements MultiLineStringTrait
Source§type MultiPolygonType<'b> = MultiPolygon<<&'a LineString<T> as GeometryTrait>::T>
where
Self: 'b
type MultiPolygonType<'b> = MultiPolygon<<&'a LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying MultiPolygon, which implements MultiPolygonTrait
Source§type GeometryCollectionType<'b> = GeometryCollection<<&'a LineString<T> as GeometryTrait>::T>
where
Self: 'b
type GeometryCollectionType<'b> = GeometryCollection<<&'a LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying GeometryCollection, which implements GeometryCollectionTrait
Source§type RectType<'b> = UnimplementedRect<T>
where
Self: 'b
type RectType<'b> = UnimplementedRect<T> where Self: 'b
The type of each underlying Rect, which implements RectTrait
Source§type LineType<'b> = UnimplementedLine<T>
where
Self: 'b
type LineType<'b> = UnimplementedLine<T> where Self: 'b
The type of each underlying Line, which implements LineTrait
Source§type TriangleType<'b> = UnimplementedTriangle<T>
where
Self: 'b
type TriangleType<'b> = UnimplementedTriangle<T> where Self: 'b
The type of each underlying Triangle, which implements TriangleTrait
Source§fn dim(&self) -> Dimensions
fn dim(&self) -> Dimensions
The dimension of this geometry
Source§fn as_type(
&self,
) -> GeometryType<'_, Point<T>, LineString<T>, Polygon<T>, MultiPoint<T>, MultiLineString<T>, MultiPolygon<T>, GeometryCollection<T>, Self::RectType<'_>, Self::TriangleType<'_>, Self::LineType<'_>>
fn as_type( &self, ) -> GeometryType<'_, Point<T>, LineString<T>, Polygon<T>, MultiPoint<T>, MultiLineString<T>, MultiPolygon<T>, GeometryCollection<T>, Self::RectType<'_>, Self::TriangleType<'_>, Self::LineType<'_>>
Cast this geometry to a
GeometryType enum, which allows for downcasting to a specific
typeSource§impl<T: WktNum> GeometryTrait for LineString<T>
impl<T: WktNum> GeometryTrait for LineString<T>
Source§type PointType<'b> = Point<<LineString<T> as GeometryTrait>::T>
where
Self: 'b
type PointType<'b> = Point<<LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying Point, which implements PointTrait
Source§type LineStringType<'b> = LineString<<LineString<T> as GeometryTrait>::T>
where
Self: 'b
type LineStringType<'b> = LineString<<LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying LineString, which implements LineStringTrait
Source§type PolygonType<'b> = Polygon<<LineString<T> as GeometryTrait>::T>
where
Self: 'b
type PolygonType<'b> = Polygon<<LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying Polygon, which implements PolygonTrait
Source§type MultiPointType<'b> = MultiPoint<<LineString<T> as GeometryTrait>::T>
where
Self: 'b
type MultiPointType<'b> = MultiPoint<<LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying MultiPoint, which implements MultiPointTrait
Source§type MultiLineStringType<'b> = MultiLineString<<LineString<T> as GeometryTrait>::T>
where
Self: 'b
type MultiLineStringType<'b> = MultiLineString<<LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying MultiLineString, which implements MultiLineStringTrait
Source§type MultiPolygonType<'b> = MultiPolygon<<LineString<T> as GeometryTrait>::T>
where
Self: 'b
type MultiPolygonType<'b> = MultiPolygon<<LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying MultiPolygon, which implements MultiPolygonTrait
Source§type GeometryCollectionType<'b> = GeometryCollection<<LineString<T> as GeometryTrait>::T>
where
Self: 'b
type GeometryCollectionType<'b> = GeometryCollection<<LineString<T> as GeometryTrait>::T> where Self: 'b
The type of each underlying GeometryCollection, which implements GeometryCollectionTrait
Source§type RectType<'b> = UnimplementedRect<T>
where
Self: 'b
type RectType<'b> = UnimplementedRect<T> where Self: 'b
The type of each underlying Rect, which implements RectTrait
Source§type LineType<'b> = UnimplementedLine<T>
where
Self: 'b
type LineType<'b> = UnimplementedLine<T> where Self: 'b
The type of each underlying Line, which implements LineTrait
Source§type TriangleType<'b> = UnimplementedTriangle<T>
where
Self: 'b
type TriangleType<'b> = UnimplementedTriangle<T> where Self: 'b
The type of each underlying Triangle, which implements TriangleTrait
Source§fn dim(&self) -> Dimensions
fn dim(&self) -> Dimensions
The dimension of this geometry
Source§fn as_type(
&self,
) -> GeometryType<'_, Point<T>, LineString<T>, Polygon<T>, MultiPoint<T>, MultiLineString<T>, MultiPolygon<T>, GeometryCollection<T>, Self::RectType<'_>, Self::TriangleType<'_>, Self::LineType<'_>>
fn as_type( &self, ) -> GeometryType<'_, Point<T>, LineString<T>, Polygon<T>, MultiPoint<T>, MultiLineString<T>, MultiPolygon<T>, GeometryCollection<T>, Self::RectType<'_>, Self::TriangleType<'_>, Self::LineType<'_>>
Cast this geometry to a
GeometryType enum, which allows for downcasting to a specific
typeSource§impl<'a, T: WktNum> LineStringTrait for &'a LineString<T>
impl<'a, T: WktNum> LineStringTrait for &'a LineString<T>
Source§type CoordType<'b> = &'a Coord<T>
where
Self: 'b
type CoordType<'b> = &'a Coord<T> where Self: 'b
The type of each underlying coordinate, which implements CoordTrait
Source§fn num_coords(&self) -> usize
fn num_coords(&self) -> usize
The number of coordinates in this LineString
Source§unsafe fn coord_unchecked(&self, i: usize) -> Self::CoordType<'_>
unsafe fn coord_unchecked(&self, i: usize) -> Self::CoordType<'_>
Access to a specified coordinate in this LineString Read more
Source§fn coords(&self) -> impl DoubleEndedIterator + ExactSizeIterator
fn coords(&self) -> impl DoubleEndedIterator + ExactSizeIterator
An iterator over the coordinates in this LineString
Source§impl<T: WktNum> LineStringTrait for LineString<T>
impl<T: WktNum> LineStringTrait for LineString<T>
Source§type CoordType<'a> = &'a Coord<T>
where
Self: 'a
type CoordType<'a> = &'a Coord<T> where Self: 'a
The type of each underlying coordinate, which implements CoordTrait
Source§fn num_coords(&self) -> usize
fn num_coords(&self) -> usize
The number of coordinates in this LineString
Source§unsafe fn coord_unchecked(&self, i: usize) -> Self::CoordType<'_>
unsafe fn coord_unchecked(&self, i: usize) -> Self::CoordType<'_>
Access to a specified coordinate in this LineString Read more
Source§fn coords(&self) -> impl DoubleEndedIterator + ExactSizeIterator
fn coords(&self) -> impl DoubleEndedIterator + ExactSizeIterator
An iterator over the coordinates in this LineString
impl<T: WktNum> StructuralPartialEq for LineString<T>
Auto Trait Implementations§
impl<T> Freeze for LineString<T>
impl<T> RefUnwindSafe for LineString<T>where
T: RefUnwindSafe,
impl<T> Send for LineString<T>where
T: Send,
impl<T> Sync for LineString<T>where
T: Sync,
impl<T> Unpin for LineString<T>where
T: Unpin,
impl<T> UnwindSafe for LineString<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, G> ToGeoGeometry<T> for Gwhere
T: CoordNum,
G: GeometryTrait<T = T>,
impl<T, G> ToGeoGeometry<T> for Gwhere
T: CoordNum,
G: GeometryTrait<T = T>,
Source§impl<T, G> ToGeoLineString<T> for Gwhere
T: CoordNum,
G: LineStringTrait<T = T>,
impl<T, G> ToGeoLineString<T> for Gwhere
T: CoordNum,
G: LineStringTrait<T = T>,
Source§fn to_line_string(&self) -> LineString<T>
fn to_line_string(&self) -> LineString<T>
Convert to a geo_types
LineString.