pub struct LineString<T = f64>(pub Vec<Coord<T>>)
where
T: CoordNum;
Expand description
An ordered collection of Coord
s, representing a path between locations.
To be valid, a LineString
must be empty, or have two or more coords.
§Semantics
- A
LineString
is closed if it is empty, or if the first and last coordinates are the same. - The boundary of a
LineString
is either:- empty if it is closed (see 1) or
- contains the start and end coordinates.
- The interior is the (infinite) set of all coordinates along the
LineString
, not including the boundary. - A
LineString
is simple if it does not intersect except optionally at the first and last coordinates (in which case it is also closed, see 1). - A simple and closed
LineString
is aLinearRing
as defined in the OGC-SFA (but is not defined as a separate type in this crate).
§Validity
A LineString
is valid if it is either empty or
contains 2 or more coordinates.
Further, a closed LineString
must not self-intersect. Note that its
validity is not enforced, and operations and
predicates are undefined on invalid LineString
s.
§Examples
§Creation
Create a LineString
by calling it directly:
use geo_types::{coord, LineString};
let line_string = LineString::new(vec![
coord! { x: 0., y: 0. },
coord! { x: 10., y: 0. },
]);
Create a LineString
with the line_string!
macro:
use geo_types::line_string;
let line_string = line_string![
(x: 0., y: 0.),
(x: 10., y: 0.),
];
By converting from a Vec
of coordinate-like things:
use geo_types::LineString;
let line_string: LineString<f32> = vec![(0., 0.), (10., 0.)].into();
use geo_types::LineString;
let line_string: LineString = vec![[0., 0.], [10., 0.]].into();
Or by collect
ing from a Coord
iterator
use geo_types::{coord, LineString};
let mut coords_iter =
vec![coord! { x: 0., y: 0. }, coord! { x: 10., y: 0. }].into_iter();
let line_string: LineString<f32> = coords_iter.collect();
§Iteration
LineString
provides five iterators: coords
, coords_mut
, points
, lines
, and triangles
:
use geo_types::{coord, LineString};
let line_string = LineString::new(vec![
coord! { x: 0., y: 0. },
coord! { x: 10., y: 0. },
]);
line_string.coords().for_each(|coord| println!("{:?}", coord));
for point in line_string.points() {
println!("Point x = {}, y = {}", point.x(), point.y());
}
Note that its IntoIterator
impl yields Coord
s when looping:
use geo_types::{coord, LineString};
let line_string = LineString::new(vec![
coord! { x: 0., y: 0. },
coord! { x: 10., y: 0. },
]);
for coord in &line_string {
println!("Coordinate x = {}, y = {}", coord.x, coord.y);
}
for coord in line_string {
println!("Coordinate x = {}, y = {}", coord.x, coord.y);
}
§Decomposition
You can decompose a LineString
into a Vec
of Coord
s or Point
s:
use geo_types::{coord, LineString, Point};
let line_string = LineString::new(vec![
coord! { x: 0., y: 0. },
coord! { x: 10., y: 0. },
]);
let coordinate_vec = line_string.clone().into_inner();
let point_vec = line_string.clone().into_points();
Tuple Fields§
§0: Vec<Coord<T>>
Implementations§
Source§impl<T> LineString<T>where
T: CoordNum,
impl<T> LineString<T>where
T: CoordNum,
Sourcepub fn new(value: Vec<Coord<T>>) -> LineString<T>
pub fn new(value: Vec<Coord<T>>) -> LineString<T>
Instantiate Self from the raw content value
Sourcepub fn points_iter(&self) -> PointsIter<'_, T>
👎Deprecated: Use points() instead
pub fn points_iter(&self) -> PointsIter<'_, T>
Return an iterator yielding the coordinates of a LineString
as Point
s
Sourcepub fn points(&self) -> PointsIter<'_, T>
pub fn points(&self) -> PointsIter<'_, T>
Return an iterator yielding the coordinates of a LineString
as Point
s
Sourcepub fn coords(&self) -> impl DoubleEndedIterator
pub fn coords(&self) -> impl DoubleEndedIterator
Return an iterator yielding the members of a LineString
as Coord
s
Sourcepub fn coords_mut(&mut self) -> impl DoubleEndedIterator
pub fn coords_mut(&mut self) -> impl DoubleEndedIterator
Return an iterator yielding the coordinates of a LineString
as mutable Coord
s
Sourcepub fn into_points(self) -> Vec<Point<T>>
pub fn into_points(self) -> Vec<Point<T>>
Return the coordinates of a LineString
as a Vec
of Point
s
Sourcepub fn into_inner(self) -> Vec<Coord<T>>
pub fn into_inner(self) -> Vec<Coord<T>>
Return the coordinates of a LineString
as a Vec
of Coord
s
Sourcepub fn lines(&self) -> impl ExactSizeIterator
pub fn lines(&self) -> impl ExactSizeIterator
Return an iterator yielding one Line for each line segment
in the LineString
.
§Examples
use geo_types::{coord, Line, LineString};
let mut coords = vec![(0., 0.), (5., 0.), (7., 9.)];
let line_string: LineString<f32> = coords.into_iter().collect();
let mut lines = line_string.lines();
assert_eq!(
Some(Line::new(
coord! { x: 0., y: 0. },
coord! { x: 5., y: 0. }
)),
lines.next()
);
assert_eq!(
Some(Line::new(
coord! { x: 5., y: 0. },
coord! { x: 7., y: 9. }
)),
lines.next()
);
assert!(lines.next().is_none());
Sourcepub fn triangles(&self) -> impl ExactSizeIterator
pub fn triangles(&self) -> impl ExactSizeIterator
An iterator which yields the coordinates of a LineString
as Triangles
Sourcepub fn close(&mut self)
pub fn close(&mut self)
Close the LineString
. Specifically, if the LineString
has at least one Coord
, and
the value of the first Coord
does not equal the value of the last Coord
, then a
new Coord
is added to the end with the value of the first Coord
.
Sourcepub fn num_coords(&self) -> usize
👎Deprecated: Use geo::CoordsIter::coords_count instead
pub fn num_coords(&self) -> usize
Return the number of coordinates in the LineString
.
§Examples
use geo_types::LineString;
let mut coords = vec![(0., 0.), (5., 0.), (7., 9.)];
let line_string: LineString<f32> = coords.into_iter().collect();
assert_eq!(3, line_string.num_coords());
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Checks if the linestring is closed; i.e. it is either empty or, the first and last points are the same.
§Examples
use geo_types::LineString;
let mut coords = vec![(0., 0.), (5., 0.), (0., 0.)];
let line_string: LineString<f32> = coords.into_iter().collect();
assert!(line_string.is_closed());
Note that we diverge from some libraries (JTS et al), which have a LinearRing
type,
separate from LineString
. Those libraries treat an empty LinearRing
as closed by
definition, while treating an empty LineString
as open. Since we don’t have a separate
LinearRing
type, and use a LineString
in its place, we adopt the JTS LinearRing
is_closed
behavior in all places: that is, we consider an empty LineString
as closed.
This is expected when used in the context of a Polygon.exterior
and elsewhere; And there
seems to be no reason to maintain the separate behavior for LineString
s used in
non-LinearRing
contexts.
Trait Implementations§
Source§impl<T> AbsDiffEq for LineString<T>
impl<T> AbsDiffEq for LineString<T>
Source§fn abs_diff_eq(
&self,
other: &LineString<T>,
epsilon: <LineString<T> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &LineString<T>, epsilon: <LineString<T> as AbsDiffEq>::Epsilon, ) -> bool
Equality assertion with an absolute limit.
§Examples
use geo_types::LineString;
let mut coords_a = vec![(0., 0.), (5., 0.), (7., 9.)];
let a: LineString<f32> = coords_a.into_iter().collect();
let mut coords_b = vec![(0., 0.), (5., 0.), (7.001, 9.)];
let b: LineString<f32> = coords_b.into_iter().collect();
approx::assert_relative_eq!(a, b, epsilon=0.1)
Source§fn default_epsilon() -> <LineString<T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <LineString<T> as AbsDiffEq>::Epsilon
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.Source§impl<T> Area<T> for LineString<T>where
T: CoordNum,
impl<T> Area<T> for LineString<T>where
T: CoordNum,
fn signed_area(&self) -> T
fn unsigned_area(&self) -> T
Source§impl<T> BoundingRect<T> for LineString<T>where
T: CoordNum,
impl<T> BoundingRect<T> for LineString<T>where
T: CoordNum,
Source§impl<T> Centroid for LineString<T>where
T: GeoFloat,
impl<T> Centroid for LineString<T>where
T: GeoFloat,
Source§fn centroid(&self) -> Self::Output
fn centroid(&self) -> Self::Output
§Examples
use geo::Centroid;
use geo::{line_string, point};
let line_string = line_string![
(x: 1.0f32, y: 1.0),
(x: 2.0, y: 2.0),
(x: 4.0, y: 4.0)
];
assert_eq!(
// (1.0 * (1.5, 1.5) + 2.0 * (3.0, 3.0)) / 3.0
Some(point!(x: 2.5, y: 2.5)),
line_string.centroid(),
);
type Output = Option<Point<T>>
Source§impl<T> ChaikinSmoothing<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
impl<T> ChaikinSmoothing<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
Source§fn chaikin_smoothing(&self, n_iterations: usize) -> Self
fn chaikin_smoothing(&self, n_iterations: usize) -> Self
n_iterations
times.Source§impl<T> ChamberlainDuquetteArea<T> for LineString<T>where
T: CoordFloat,
impl<T> ChamberlainDuquetteArea<T> for LineString<T>where
T: CoordFloat,
fn chamberlain_duquette_signed_area(&self) -> T
fn chamberlain_duquette_unsigned_area(&self) -> T
Source§impl<T> Clone for LineString<T>
impl<T> Clone for LineString<T>
Source§fn clone(&self) -> LineString<T>
fn clone(&self) -> LineString<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<F: GeoFloat> ClosestPoint<F> for LineString<F>
impl<F: GeoFloat> ClosestPoint<F> for LineString<F>
Source§fn closest_point(&self, p: &Point<F>) -> Closest<F>
fn closest_point(&self, p: &Point<F>) -> Closest<F>
self
and p
.Source§impl<T> ConcaveHull for LineString<T>
impl<T> ConcaveHull for LineString<T>
Source§impl<T> Contains<GeometryCollection<T>> for LineString<T>where
T: GeoFloat,
impl<T> Contains<GeometryCollection<T>> for LineString<T>where
T: GeoFloat,
fn contains(&self, target: &GeometryCollection<T>) -> bool
Source§impl<F> Contains<LineString<F>> for MultiPolygon<F>where
F: GeoFloat,
impl<F> Contains<LineString<F>> for MultiPolygon<F>where
F: GeoFloat,
fn contains(&self, rhs: &LineString<F>) -> bool
Source§impl<T> Contains<LineString<T>> for Geometry<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for Geometry<T>where
T: GeoFloat,
fn contains(&self, line_string: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for GeometryCollection<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for GeometryCollection<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for Line<T>where
T: GeoNum,
impl<T> Contains<LineString<T>> for Line<T>where
T: GeoNum,
fn contains(&self, linestring: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for MultiLineString<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for MultiLineString<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for MultiPoint<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for MultiPoint<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for Point<T>where
T: CoordNum,
impl<T> Contains<LineString<T>> for Point<T>where
T: CoordNum,
fn contains(&self, line_string: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for Polygon<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for Polygon<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for Rect<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for Rect<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
Source§impl<T> Contains<LineString<T>> for Triangle<T>where
T: GeoFloat,
impl<T> Contains<LineString<T>> for Triangle<T>where
T: GeoFloat,
fn contains(&self, target: &LineString<T>) -> bool
Source§impl<T> Contains<MultiLineString<T>> for LineString<T>where
T: GeoFloat,
impl<T> Contains<MultiLineString<T>> for LineString<T>where
T: GeoFloat,
fn contains(&self, target: &MultiLineString<T>) -> bool
Source§impl<T> Contains<MultiPoint<T>> for LineString<T>where
T: GeoFloat,
impl<T> Contains<MultiPoint<T>> for LineString<T>where
T: GeoFloat,
fn contains(&self, target: &MultiPoint<T>) -> bool
Source§impl<T> Contains<MultiPolygon<T>> for LineString<T>where
T: GeoFloat,
impl<T> Contains<MultiPolygon<T>> for LineString<T>where
T: GeoFloat,
fn contains(&self, target: &MultiPolygon<T>) -> bool
Source§impl<T> Contains for LineString<T>where
T: GeoNum,
impl<T> Contains for LineString<T>where
T: GeoNum,
fn contains(&self, rhs: &LineString<T>) -> bool
Source§impl<T> CoordinatePosition for LineString<T>where
T: GeoNum,
impl<T> CoordinatePosition for LineString<T>where
T: GeoNum,
Source§impl<T: CoordNum> CoordsIter for LineString<T>
impl<T: CoordNum> CoordsIter for LineString<T>
Source§fn coords_count(&self) -> usize
fn coords_count(&self) -> usize
Return the number of coordinates in the LineString
.
type Iter<'a> = Copied<Iter<'a, Coord<T>>> where T: 'a
type ExteriorIter<'a> = <LineString<T> as CoordsIter>::Iter<'a> where T: 'a
type Scalar = T
Source§fn coords_iter(&self) -> Self::Iter<'_>
fn coords_iter(&self) -> Self::Iter<'_>
Source§fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
fn exterior_coords_iter(&self) -> Self::ExteriorIter<'_>
Source§impl<T> Debug for LineString<T>
impl<T> Debug for LineString<T>
Source§impl<F: CoordFloat + FromPrimitive> Densify<F> for LineString<F>
impl<F: CoordFloat + FromPrimitive> Densify<F> for LineString<F>
type Output = LineString<F>
fn densify<MetricSpace>(&self, max_segment_length: F) -> LineString<F>
Source§impl<T> DensifyHaversine<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
Line<T>: HaversineLength<T>,
LineString<T>: HaversineLength<T>,
impl<T> DensifyHaversine<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
Line<T>: HaversineLength<T>,
LineString<T>: HaversineLength<T>,
Source§type Output = LineString<T>
type Output = LineString<T>
line.densify::<Haversine>()
via the Densify
trait instead.Source§fn densify_haversine(&self, max_distance: T) -> Self::Output
fn densify_haversine(&self, max_distance: T) -> Self::Output
line.densify::<Haversine>()
via the Densify
trait instead.Source§impl<F> Distance<F, &Geometry<F>, &LineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &LineString<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Geometry<F>, b: &LineString<F>) -> F
fn distance(a: &Geometry<F>, b: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &GeometryCollection<F>, &LineString<F>> for Euclidean
Source§fn distance(
iter_geometry: &GeometryCollection<F>,
to_geometry: &LineString<F>,
) -> F
fn distance( iter_geometry: &GeometryCollection<F>, to_geometry: &LineString<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &Line<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &Line<F>, &LineString<F>> for Euclidean
Source§fn distance(line: &Line<F>, line_string: &LineString<F>) -> F
fn distance(line: &Line<F>, line_string: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &LineString<F>, &Geometry<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &LineString<F>, &Geometry<F>> for Euclidean
Source§fn distance(origin: &LineString<F>, destination: &Geometry<F>) -> F
fn distance(origin: &LineString<F>, destination: &Geometry<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &GeometryCollection<F>) -> F
fn distance(a: &LineString<F>, b: &GeometryCollection<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &Line<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &Line<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &Line<F>) -> F
fn distance(a: &LineString<F>, b: &Line<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &LineString<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &LineString<F>, &LineString<F>> for Euclidean
Source§fn distance(line_string_a: &LineString<F>, line_string_b: &LineString<F>) -> F
fn distance(line_string_a: &LineString<F>, line_string_b: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &MultiLineString<F>) -> F
fn distance(a: &LineString<F>, b: &MultiLineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &MultiPoint<F>) -> F
fn distance(a: &LineString<F>, b: &MultiPoint<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &MultiPolygon<F>) -> F
fn distance(a: &LineString<F>, b: &MultiPolygon<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &Point<F>> for Euclideanwhere
F: CoordFloat,
impl<F> Distance<F, &LineString<F>, &Point<F>> for Euclideanwhere
F: CoordFloat,
Source§fn distance(a: &LineString<F>, b: &Point<F>) -> F
fn distance(a: &LineString<F>, b: &Point<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &LineString<F>, &Polygon<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &LineString<F>, &Polygon<F>> for Euclidean
Source§fn distance(line_string: &LineString<F>, polygon: &Polygon<F>) -> F
fn distance(line_string: &LineString<F>, polygon: &Polygon<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &Rect<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &Rect<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &Rect<F>) -> F
fn distance(a: &LineString<F>, b: &Rect<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &LineString<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &LineString<F>, b: &Triangle<F>) -> F
fn distance(a: &LineString<F>, b: &Triangle<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiLineString<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiLineString<F>, &LineString<F>> for Euclidean
Source§fn distance(
iter_geometry: &MultiLineString<F>,
to_geometry: &LineString<F>,
) -> F
fn distance( iter_geometry: &MultiLineString<F>, to_geometry: &LineString<F>, ) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiPoint<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiPoint<F>, &LineString<F>> for Euclidean
Source§fn distance(iter_geometry: &MultiPoint<F>, to_geometry: &LineString<F>) -> F
fn distance(iter_geometry: &MultiPoint<F>, to_geometry: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &MultiPolygon<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &MultiPolygon<F>, &LineString<F>> for Euclidean
Source§fn distance(iter_geometry: &MultiPolygon<F>, to_geometry: &LineString<F>) -> F
fn distance(iter_geometry: &MultiPolygon<F>, to_geometry: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: CoordFloat> Distance<F, &Point<F>, &LineString<F>> for Euclidean
impl<F: CoordFloat> Distance<F, &Point<F>, &LineString<F>> for Euclidean
Source§fn distance(origin: &Point<F>, destination: &LineString<F>) -> F
fn distance(origin: &Point<F>, destination: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F> Distance<F, &Polygon<F>, &LineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &LineString<F>> for Euclideanwhere
F: GeoFloat,
Source§fn distance(a: &Polygon<F>, b: &LineString<F>) -> F
fn distance(a: &Polygon<F>, b: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &Rect<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &Rect<F>, &LineString<F>> for Euclidean
Source§fn distance(polygonlike: &Rect<F>, geometry_b: &LineString<F>) -> F
fn distance(polygonlike: &Rect<F>, geometry_b: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<F: GeoFloat> Distance<F, &Triangle<F>, &LineString<F>> for Euclidean
impl<F: GeoFloat> Distance<F, &Triangle<F>, &LineString<F>> for Euclidean
Source§fn distance(polygonlike: &Triangle<F>, geometry_b: &LineString<F>) -> F
fn distance(polygonlike: &Triangle<F>, geometry_b: &LineString<F>) -> F
Point
to Point
is supported.
See specific implementations for details. Read moreSource§impl<T> EuclideanDistance<T> for LineString<T>
LineString-LineString distance
impl<T> EuclideanDistance<T> for LineString<T>
LineString-LineString distance
Source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Geometry<T>> for LineString<T>
impl<T> EuclideanDistance<T, Geometry<T>> for LineString<T>
Source§fn euclidean_distance(&self, geom: &Geometry<T>) -> T
fn euclidean_distance(&self, geom: &Geometry<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, GeometryCollection<T>> for LineString<T>
impl<T> EuclideanDistance<T, GeometryCollection<T>> for LineString<T>
Source§fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
fn euclidean_distance(&self, target: &GeometryCollection<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Line<T>> for LineString<T>
LineString to Line
impl<T> EuclideanDistance<T, Line<T>> for LineString<T>
LineString to Line
Source§fn euclidean_distance(&self, other: &Line<T>) -> T
fn euclidean_distance(&self, other: &Line<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for Geometry<T>
impl<T> EuclideanDistance<T, LineString<T>> for Geometry<T>
Source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for GeometryCollection<T>
impl<T> EuclideanDistance<T, LineString<T>> for GeometryCollection<T>
Source§fn euclidean_distance(&self, target: &LineString<T>) -> T
fn euclidean_distance(&self, target: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for Line<T>
Line to LineString
impl<T> EuclideanDistance<T, LineString<T>> for Line<T>
Line to LineString
Source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for MultiLineString<T>
impl<T> EuclideanDistance<T, LineString<T>> for MultiLineString<T>
Source§fn euclidean_distance(&self, target: &LineString<T>) -> T
fn euclidean_distance(&self, target: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for MultiPoint<T>
impl<T> EuclideanDistance<T, LineString<T>> for MultiPoint<T>
Source§fn euclidean_distance(&self, target: &LineString<T>) -> T
fn euclidean_distance(&self, target: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for MultiPolygon<T>
impl<T> EuclideanDistance<T, LineString<T>> for MultiPolygon<T>
Source§fn euclidean_distance(&self, target: &LineString<T>) -> T
fn euclidean_distance(&self, target: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for Point<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, LineString<T>> for Point<T>where
T: GeoFloat,
Source§fn euclidean_distance(&self, line_string: &LineString<T>) -> T
👎Deprecated since 0.29.0: Please use the Euclidean::distance
method from the Distance
trait instead
fn euclidean_distance(&self, line_string: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadMinimum distance from a Point to a LineString
Source§impl<T> EuclideanDistance<T, LineString<T>> for Polygon<T>
Polygon to LineString distance
impl<T> EuclideanDistance<T, LineString<T>> for Polygon<T>
Polygon to LineString distance
Source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for Rect<T>
impl<T> EuclideanDistance<T, LineString<T>> for Rect<T>
Source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, LineString<T>> for Triangle<T>
impl<T> EuclideanDistance<T, LineString<T>> for Triangle<T>
Source§fn euclidean_distance(&self, other: &LineString<T>) -> T
fn euclidean_distance(&self, other: &LineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiLineString<T>> for LineString<T>
impl<T> EuclideanDistance<T, MultiLineString<T>> for LineString<T>
Source§fn euclidean_distance(&self, target: &MultiLineString<T>) -> T
fn euclidean_distance(&self, target: &MultiLineString<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiPoint<T>> for LineString<T>
impl<T> EuclideanDistance<T, MultiPoint<T>> for LineString<T>
Source§fn euclidean_distance(&self, target: &MultiPoint<T>) -> T
fn euclidean_distance(&self, target: &MultiPoint<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, MultiPolygon<T>> for LineString<T>
impl<T> EuclideanDistance<T, MultiPolygon<T>> for LineString<T>
Source§fn euclidean_distance(&self, target: &MultiPolygon<T>) -> T
fn euclidean_distance(&self, target: &MultiPolygon<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Point<T>> for LineString<T>where
T: GeoFloat,
impl<T> EuclideanDistance<T, Point<T>> for LineString<T>where
T: GeoFloat,
Source§fn euclidean_distance(&self, point: &Point<T>) -> T
👎Deprecated since 0.29.0: Please use the Euclidean::distance
method from the Distance
trait instead
fn euclidean_distance(&self, point: &Point<T>) -> T
Euclidean::distance
method from the Distance
trait insteadMinimum distance from a LineString to a Point
Source§impl<T> EuclideanDistance<T, Polygon<T>> for LineString<T>
LineString to Polygon
impl<T> EuclideanDistance<T, Polygon<T>> for LineString<T>
LineString to Polygon
Source§fn euclidean_distance(&self, other: &Polygon<T>) -> T
fn euclidean_distance(&self, other: &Polygon<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Rect<T>> for LineString<T>
impl<T> EuclideanDistance<T, Rect<T>> for LineString<T>
Source§fn euclidean_distance(&self, other: &Rect<T>) -> T
fn euclidean_distance(&self, other: &Rect<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanDistance<T, Triangle<T>> for LineString<T>
impl<T> EuclideanDistance<T, Triangle<T>> for LineString<T>
Source§fn euclidean_distance(&self, other: &Triangle<T>) -> T
fn euclidean_distance(&self, other: &Triangle<T>) -> T
Euclidean::distance
method from the Distance
trait insteadSource§impl<T> EuclideanLength<T> for LineString<T>where
T: CoordFloat + Sum,
impl<T> EuclideanLength<T> for LineString<T>where
T: CoordFloat + Sum,
Source§fn euclidean_length(&self) -> T
fn euclidean_length(&self) -> T
line.length::<Euclidean>()
via the Length
trait instead.Source§impl<T> FrechetDistance<T> for LineString<T>where
T: GeoFloat + FromPrimitive,
impl<T> FrechetDistance<T> for LineString<T>where
T: GeoFloat + FromPrimitive,
Source§fn frechet_distance(&self, ls: &LineString<T>) -> T
fn frechet_distance(&self, ls: &LineString<T>) -> T
Source§impl<T> From<&Line<T>> for LineString<T>where
T: CoordNum,
impl<T> From<&Line<T>> for LineString<T>where
T: CoordNum,
Source§fn from(line: &Line<T>) -> LineString<T>
fn from(line: &Line<T>) -> LineString<T>
Source§impl<'a, F: GeoFloat> From<&'a LineString<F>> for PreparedGeometry<'a, F>
impl<'a, F: GeoFloat> From<&'a LineString<F>> for PreparedGeometry<'a, F>
Source§fn from(line_string: &'a LineString<F>) -> Self
fn from(line_string: &'a LineString<F>) -> Self
Source§impl<T> From<Line<T>> for LineString<T>where
T: CoordNum,
impl<T> From<Line<T>> for LineString<T>where
T: CoordNum,
Source§fn from(line: Line<T>) -> LineString<T>
fn from(line: Line<T>) -> LineString<T>
Source§impl<'a, F: GeoFloat> From<LineString<F>> for PreparedGeometry<'a, F>
impl<'a, F: GeoFloat> From<LineString<F>> for PreparedGeometry<'a, F>
Source§fn from(line_string: LineString<F>) -> Self
fn from(line_string: LineString<F>) -> Self
Source§impl<T> From<LineString<T>> for Geometry<T>where
T: CoordNum,
impl<T> From<LineString<T>> for Geometry<T>where
T: CoordNum,
Source§fn from(x: LineString<T>) -> Geometry<T>
fn from(x: LineString<T>) -> Geometry<T>
Source§impl<T, IC> From<Vec<IC>> for LineString<T>
Turn a Vec
of Point
-like objects into a LineString
.
impl<T, IC> From<Vec<IC>> for LineString<T>
Turn a Vec
of Point
-like objects into a LineString
.
Source§fn from(v: Vec<IC>) -> LineString<T>
fn from(v: Vec<IC>) -> LineString<T>
Source§impl<T, IC> FromIterator<IC> for LineString<T>
Turn an iterator of Point
-like objects into a LineString
.
impl<T, IC> FromIterator<IC> for LineString<T>
Turn an iterator of Point
-like objects into a LineString
.
Source§fn from_iter<I>(iter: I) -> LineString<T>where
I: IntoIterator<Item = IC>,
fn from_iter<I>(iter: I) -> LineString<T>where
I: IntoIterator<Item = IC>,
Source§impl GeodesicArea<f64> for LineString
impl GeodesicArea<f64> for LineString
Source§fn geodesic_perimeter(&self) -> f64
fn geodesic_perimeter(&self) -> f64
Source§fn geodesic_area_signed(&self) -> f64
fn geodesic_area_signed(&self) -> f64
Source§fn geodesic_area_unsigned(&self) -> f64
fn geodesic_area_unsigned(&self) -> f64
Source§impl GeodesicLength<f64> for LineString
impl GeodesicLength<f64> for LineString
Source§fn geodesic_length(&self) -> f64
fn geodesic_length(&self) -> f64
line.length::<Geodesic>()
via the Length
trait instead.Source§impl<C: CoordNum> HasDimensions for LineString<C>
impl<C: CoordNum> HasDimensions for LineString<C>
Source§fn boundary_dimensions(&self) -> Dimensions
fn boundary_dimensions(&self) -> Dimensions
use geo_types::line_string;
use geo::dimensions::{HasDimensions, Dimensions};
let ls = line_string![(x: 0., y: 0.), (x: 0., y: 1.), (x: 1., y: 1.)];
assert_eq!(Dimensions::ZeroDimensional, ls.boundary_dimensions());
let ls = line_string![(x: 0., y: 0.), (x: 0., y: 1.), (x: 1., y: 1.), (x: 0., y: 0.)];
assert_eq!(Dimensions::Empty, ls.boundary_dimensions());
Source§fn dimensions(&self) -> Dimensions
fn dimensions(&self) -> Dimensions
Rect
s are 2-dimensional, but it’s possible to create degenerate Rect
s which
have either 1 or 0 dimensions. Read moreSource§impl<T> Hash for LineString<T>
impl<T> Hash for LineString<T>
Source§impl<T> HaversineClosestPoint<T> for LineString<T>where
T: GeoFloat + FromPrimitive,
impl<T> HaversineClosestPoint<T> for LineString<T>where
T: GeoFloat + FromPrimitive,
fn haversine_closest_point(&self, from: &Point<T>) -> Closest<T>
Source§impl<T> HaversineLength<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
impl<T> HaversineLength<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
Source§fn haversine_length(&self) -> T
fn haversine_length(&self) -> T
line.length::<Haversine>()
via the Length
trait instead.Source§impl<T> InteriorPoint for LineString<T>where
T: GeoFloat,
impl<T> InteriorPoint for LineString<T>where
T: GeoFloat,
Source§impl<T, G> Intersects<G> for LineString<T>
impl<T, G> Intersects<G> for LineString<T>
fn intersects(&self, geom: &G) -> bool
Source§impl<T> Intersects<LineString<T>> for Coord<T>
impl<T> Intersects<LineString<T>> for Coord<T>
fn intersects(&self, rhs: &LineString<T>) -> bool
Source§impl<T> Intersects<LineString<T>> for Line<T>
impl<T> Intersects<LineString<T>> for Line<T>
fn intersects(&self, rhs: &LineString<T>) -> bool
Source§impl<T> Intersects<LineString<T>> for Polygon<T>
impl<T> Intersects<LineString<T>> for Polygon<T>
fn intersects(&self, rhs: &LineString<T>) -> bool
Source§impl<T> Intersects<LineString<T>> for Rect<T>
impl<T> Intersects<LineString<T>> for Rect<T>
fn intersects(&self, rhs: &LineString<T>) -> bool
Source§impl<T> Intersects<LineString<T>> for Triangle<T>
impl<T> Intersects<LineString<T>> for Triangle<T>
fn intersects(&self, rhs: &LineString<T>) -> bool
Source§impl<'a, T> IntoIterator for &'a LineString<T>where
T: CoordNum,
impl<'a, T> IntoIterator for &'a LineString<T>where
T: CoordNum,
Source§impl<'a, T> IntoIterator for &'a mut LineString<T>where
T: CoordNum,
Mutably iterate over all the Coord
s in this LineString
impl<'a, T> IntoIterator for &'a mut LineString<T>where
T: CoordNum,
Mutably iterate over all the Coord
s in this LineString
Source§impl<T> IntoIterator for LineString<T>where
T: CoordNum,
Iterate over all the Coord
s in this LineString
.
impl<T> IntoIterator for LineString<T>where
T: CoordNum,
Iterate over all the Coord
s in this LineString
.
Source§impl<T: GeoNum> IsConvex for LineString<T>
impl<T: GeoNum> IsConvex for LineString<T>
Source§fn convex_orientation(
&self,
allow_collinear: bool,
specific_orientation: Option<Orientation>,
) -> Option<Orientation>
fn convex_orientation( &self, allow_collinear: bool, specific_orientation: Option<Orientation>, ) -> Option<Orientation>
allow_collinear
, and
only accepts a specific orientation if provided. Read moreSource§fn is_collinear(&self) -> bool
fn is_collinear(&self) -> bool
Source§fn is_ccw_convex(&self) -> bool
fn is_ccw_convex(&self) -> bool
Source§fn is_cw_convex(&self) -> bool
fn is_cw_convex(&self) -> bool
Source§fn is_strictly_convex(&self) -> bool
fn is_strictly_convex(&self) -> bool
Source§fn is_strictly_ccw_convex(&self) -> bool
fn is_strictly_ccw_convex(&self) -> bool
Source§fn is_strictly_cw_convex(&self) -> bool
fn is_strictly_cw_convex(&self) -> bool
Source§impl<F: CoordFloat> Length<F> for LineString<F>
impl<F: CoordFloat> Length<F> for LineString<F>
Source§impl<T> LineInterpolatePoint<T> for LineString<T>where
T: CoordFloat + AddAssign + Debug,
Line<T>: EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
impl<T> LineInterpolatePoint<T> for LineString<T>where
T: CoordFloat + AddAssign + Debug,
Line<T>: EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
Source§impl<T> LineLocatePoint<T, Point<T>> for LineString<T>where
T: CoordFloat + AddAssign,
Line<T>: EuclideanDistance<T, Point<T>> + EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
impl<T> LineLocatePoint<T, Point<T>> for LineString<T>where
T: CoordFloat + AddAssign,
Line<T>: EuclideanDistance<T, Point<T>> + EuclideanLength<T>,
LineString<T>: EuclideanLength<T>,
Source§impl LineStringSegmentize for LineString
impl LineStringSegmentize for LineString
fn line_segmentize(&self, n: usize) -> Option<MultiLineString>
Source§impl LineStringSegmentizeHaversine for LineString
impl LineStringSegmentizeHaversine for LineString
fn line_segmentize_haversine(&self, n: usize) -> Option<MultiLineString>
Source§impl<'a, T: CoordNum + 'a> LinesIter<'a> for LineString<T>
impl<'a, T: CoordNum + 'a> LinesIter<'a> for LineString<T>
type Scalar = T
type Iter = LineStringIter<'a, <LineString<T> as LinesIter<'a>>::Scalar>
Source§fn lines_iter(&'a self) -> Self::Iter
fn lines_iter(&'a self) -> Self::Iter
Source§impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for LineString<T>
impl<T: CoordNum, NT: CoordNum> MapCoords<T, NT> for LineString<T>
Source§impl<T: CoordNum> MapCoordsInPlace<T> for LineString<T>
impl<T: CoordNum> MapCoordsInPlace<T> for LineString<T>
Source§impl<T> PartialEq for LineString<T>
impl<T> PartialEq for LineString<T>
Source§impl<T> PointDistance for LineString<T>
impl<T> PointDistance for LineString<T>
Source§fn distance_2(&self, point: &Point<T>) -> T
fn distance_2(&self, point: &Point<T>) -> T
Source§fn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
fn contains_point(&self, point: &<Self::Envelope as Envelope>::Point) -> bool
true
if a point is contained within this object. Read moreSource§fn distance_2_if_less_or_equal(
&self,
point: &<Self::Envelope as Envelope>::Point,
max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar,
) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
fn distance_2_if_less_or_equal( &self, point: &<Self::Envelope as Envelope>::Point, max_distance_2: <<Self::Envelope as Envelope>::Point as Point>::Scalar, ) -> Option<<<Self::Envelope as Envelope>::Point as Point>::Scalar>
None
if the distance
is larger than a given maximum value. Read moreSource§impl<T> RTreeObject for LineString<T>
impl<T> RTreeObject for LineString<T>
Source§impl<F: GeoFloat> Relate<F> for LineString<F>
impl<F: GeoFloat> Relate<F> for LineString<F>
Source§fn geometry_graph(&self, arg_index: usize) -> GeometryGraph<'_, F>
fn geometry_graph(&self, arg_index: usize) -> GeometryGraph<'_, F>
GeometryGraph
fn relate(&self, other: &impl Relate<F>) -> IntersectionMatrix
Source§impl<T> RelativeEq for LineString<T>
impl<T> RelativeEq for LineString<T>
Source§fn relative_eq(
&self,
other: &LineString<T>,
epsilon: <LineString<T> as AbsDiffEq>::Epsilon,
max_relative: <LineString<T> as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &LineString<T>, epsilon: <LineString<T> as AbsDiffEq>::Epsilon, max_relative: <LineString<T> as AbsDiffEq>::Epsilon, ) -> bool
Equality assertion within a relative limit.
§Examples
use geo_types::LineString;
let mut coords_a = vec![(0., 0.), (5., 0.), (7., 9.)];
let a: LineString<f32> = coords_a.into_iter().collect();
let mut coords_b = vec![(0., 0.), (5., 0.), (7.001, 9.)];
let b: LineString<f32> = coords_b.into_iter().collect();
approx::assert_relative_eq!(a, b, max_relative=0.1)
Source§fn default_max_relative() -> <LineString<T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <LineString<T> as AbsDiffEq>::Epsilon
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq
.Source§impl<T> RemoveRepeatedPoints<T> for LineString<T>where
T: CoordNum + FromPrimitive,
impl<T> RemoveRepeatedPoints<T> for LineString<T>where
T: CoordNum + FromPrimitive,
Source§fn remove_repeated_points(&self) -> Self
fn remove_repeated_points(&self) -> Self
Create a LineString with consecutive repeated points removed.
Source§fn remove_repeated_points_mut(&mut self)
fn remove_repeated_points_mut(&mut self)
Remove consecutive repeated points from a LineString inplace.
Source§impl<T> RhumbLength<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
impl<T> RhumbLength<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
Source§fn rhumb_length(&self) -> T
fn rhumb_length(&self) -> T
line.length::<Rhumb>()
via the Length
trait instead.Source§impl<T> Simplify<T> for LineString<T>where
T: GeoFloat,
impl<T> Simplify<T> for LineString<T>where
T: GeoFloat,
Source§impl<T> SimplifyIdx<T> for LineString<T>where
T: GeoFloat,
impl<T> SimplifyIdx<T> for LineString<T>where
T: GeoFloat,
Source§fn simplify_idx(&self, epsilon: &T) -> Vec<usize>
fn simplify_idx(&self, epsilon: &T) -> Vec<usize>
Source§impl<T> SimplifyVw<T> for LineString<T>where
T: CoordFloat,
impl<T> SimplifyVw<T> for LineString<T>where
T: CoordFloat,
Source§fn simplify_vw(&self, epsilon: &T) -> LineString<T>
fn simplify_vw(&self, epsilon: &T) -> LineString<T>
Source§impl<T> SimplifyVwIdx<T> for LineString<T>where
T: CoordFloat,
impl<T> SimplifyVwIdx<T> for LineString<T>where
T: CoordFloat,
Source§fn simplify_vw_idx(&self, epsilon: &T) -> Vec<usize>
fn simplify_vw_idx(&self, epsilon: &T) -> Vec<usize>
Source§impl<T> SimplifyVwPreserve<T> for LineString<T>
impl<T> SimplifyVwPreserve<T> for LineString<T>
Source§fn simplify_vw_preserve(&self, epsilon: &T) -> LineString<T>
fn simplify_vw_preserve(&self, epsilon: &T) -> LineString<T>
Source§impl<T> TryFrom<Geometry<T>> for LineString<T>where
T: CoordNum,
Convert a Geometry enum into its inner type.
impl<T> TryFrom<Geometry<T>> for LineString<T>where
T: CoordNum,
Convert a Geometry enum into its inner type.
Fails if the enum case does not match the type you are trying to convert it to.
Source§impl<T> VincentyLength<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
impl<T> VincentyLength<T> for LineString<T>where
T: CoordFloat + FromPrimitive,
Source§fn vincenty_length(&self) -> Result<T, FailedToConvergeError>
fn vincenty_length(&self) -> Result<T, FailedToConvergeError>
Source§impl<T, K> Winding for LineString<T>
impl<T, K> Winding for LineString<T>
Source§fn points_cw(&self) -> Points<'_, Self::Scalar> ⓘ
fn points_cw(&self) -> Points<'_, Self::Scalar> ⓘ
Iterate over the points in a clockwise order
The Linestring isn’t changed, and the points are returned either in order, or in reverse order, so that the resultant order makes it appear clockwise
Source§fn points_ccw(&self) -> Points<'_, Self::Scalar> ⓘ
fn points_ccw(&self) -> Points<'_, Self::Scalar> ⓘ
Iterate over the points in a counter-clockwise order
The Linestring isn’t changed, and the points are returned either in order, or in reverse order, so that the resultant order makes it appear counter-clockwise
Source§fn make_cw_winding(&mut self)
fn make_cw_winding(&mut self)
Change this line’s points so they are in clockwise winding order
Source§fn make_ccw_winding(&mut self)
fn make_ccw_winding(&mut self)
Change this line’s points so they are in counterclockwise winding order
type Scalar = T
Source§fn winding_order(&self) -> Option<WindingOrder>
fn winding_order(&self) -> Option<WindingOrder>
None
otherwise.Source§fn clone_to_winding_order(&self, winding_order: WindingOrder) -> Self
fn clone_to_winding_order(&self, winding_order: WindingOrder) -> Self
Source§fn make_winding_order(&mut self, winding_order: WindingOrder)
fn make_winding_order(&mut self, winding_order: WindingOrder)
impl<T> Eq for LineString<T>
impl<T> StructuralPartialEq for LineString<T>where
T: CoordNum,
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, M> AffineOps<T> for M
impl<T, M> AffineOps<T> for M
Source§fn affine_transform(&self, transform: &AffineTransform<T>) -> M
fn affine_transform(&self, transform: &AffineTransform<T>) -> M
transform
immutably, outputting a new geometry.Source§fn affine_transform_mut(&mut self, transform: &AffineTransform<T>)
fn affine_transform_mut(&mut self, transform: &AffineTransform<T>)
transform
to mutate self
.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<Scalar = T>,
impl<'a, T, G> ConvexHull<'a, T> for Gwhere
T: GeoNum,
G: CoordsIter<Scalar = T>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<Scalar = T>,
T: CoordNum,
impl<'a, T, G> Extremes<'a, T> for Gwhere
G: CoordsIter<Scalar = T>,
T: CoordNum,
Source§impl<T, G> HausdorffDistance<T> for Gwhere
T: GeoFloat,
G: CoordsIter<Scalar = T>,
impl<T, G> HausdorffDistance<T> for Gwhere
T: GeoFloat,
G: CoordsIter<Scalar = T>,
fn hausdorff_distance<Rhs>(&self, rhs: &Rhs) -> Twhere
Rhs: CoordsIter<Scalar = T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T, G> MinimumRotatedRect<T> for G
impl<T, G> MinimumRotatedRect<T> for G
type Scalar = T
fn minimum_rotated_rect( &self, ) -> Option<Polygon<<G as MinimumRotatedRect<T>>::Scalar>>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<G, IP, IR, T> Rotate<T> for G
impl<G, IP, IR, T> Rotate<T> for G
Source§fn rotate_around_centroid(&self, degrees: T) -> G
fn rotate_around_centroid(&self, degrees: T) -> G
Source§fn rotate_around_centroid_mut(&mut self, degrees: T)
fn rotate_around_centroid_mut(&mut self, degrees: T)
Self::rotate_around_centroid
Source§fn rotate_around_center(&self, degrees: T) -> G
fn rotate_around_center(&self, degrees: T) -> G
Source§fn rotate_around_center_mut(&mut self, degrees: T)
fn rotate_around_center_mut(&mut self, degrees: T)
Self::rotate_around_center
Source§fn rotate_around_point(&self, degrees: T, point: Point<T>) -> G
fn rotate_around_point(&self, degrees: T, point: Point<T>) -> G
Source§fn rotate_around_point_mut(&mut self, degrees: T, point: Point<T>)
fn rotate_around_point_mut(&mut self, degrees: T, point: Point<T>)
Self::rotate_around_point
Source§impl<T, IR, G> Scale<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
impl<T, IR, G> Scale<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
Source§fn scale(&self, scale_factor: T) -> G
fn scale(&self, scale_factor: T) -> G
Source§fn scale_xy(&self, x_factor: T, y_factor: T) -> G
fn scale_xy(&self, x_factor: T, y_factor: T) -> G
x_factor
and
y_factor
to distort the geometry’s aspect ratio. Read moreSource§fn scale_xy_mut(&mut self, x_factor: T, y_factor: T)
fn scale_xy_mut(&mut self, x_factor: T, y_factor: T)
scale_xy
.Source§fn scale_around_point(
&self,
x_factor: T,
y_factor: T,
origin: impl Into<Coord<T>>,
) -> G
fn scale_around_point( &self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>>, ) -> G
origin
. Read moreSource§fn scale_around_point_mut(
&mut self,
x_factor: T,
y_factor: T,
origin: impl Into<Coord<T>>,
)
fn scale_around_point_mut( &mut self, x_factor: T, y_factor: T, origin: impl Into<Coord<T>>, )
scale_around_point
.Source§impl<T, IR, G> Skew<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
impl<T, IR, G> Skew<T> for Gwhere
T: CoordFloat,
IR: Into<Option<Rect<T>>>,
G: Clone + AffineOps<T> + BoundingRect<T, Output = IR>,
Source§fn skew(&self, degrees: T) -> G
fn skew(&self, degrees: T) -> G
Source§fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
fn skew_xy(&self, degrees_x: T, degrees_y: T) -> G
Source§fn skew_xy_mut(&mut self, degrees_x: T, degrees_y: T)
fn skew_xy_mut(&mut self, degrees_x: T, degrees_y: T)
skew_xy
.Source§fn skew_around_point(&self, xs: T, ys: T, origin: impl Into<Coord<T>>) -> G
fn skew_around_point(&self, xs: T, ys: T, origin: impl Into<Coord<T>>) -> G
origin
, sheared by an
angle along the x and y dimensions. Read moreSource§fn skew_around_point_mut(&mut self, xs: T, ys: T, origin: impl Into<Coord<T>>)
fn skew_around_point_mut(&mut self, xs: T, ys: T, origin: impl Into<Coord<T>>)
skew_around_point
.