Struct geo::Line
[−]
[src]
pub struct Line<T> where
T: CoordinateType, { pub start: Point<T>, pub end: Point<T>, }
A line segment made up of exactly two Point
s
Fields
start: Point<T>
end: Point<T>
Methods
impl<T> Line<T> where
T: CoordinateType,
[src]
T: CoordinateType,
pub fn new(start: Point<T>, end: Point<T>) -> Line<T>
[src]
Creates a new line segment.
use geo::{Point, Line}; let line = Line::new(Point::new(0., 0.), Point::new(1., 2.)); assert_eq!(line.start, Point::new(0., 0.)); assert_eq!(line.end, Point::new(1., 2.));
Trait Implementations
impl<T: PartialEq> PartialEq for Line<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn eq(&self, __arg_0: &Line<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Line<T>) -> bool
[src]
This method tests for !=
.
impl<T: Clone> Clone for Line<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn clone(&self) -> Line<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Copy> Copy for Line<T> where
T: CoordinateType,
[src]
T: CoordinateType,
impl<T: Debug> Debug for Line<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<T> Centroid<T> for Line<T> where
T: Float,
[src]
T: Float,
type Output = Point<T>
fn centroid(&self) -> Self::Output
[src]
See: https://en.wikipedia.org/wiki/Centroid Read more
impl<T> Contains<Point<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn contains(&self, p: &Point<T>) -> bool
[src]
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Contains<Line<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn contains(&self, line: &Line<T>) -> bool
[src]
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Contains<LineString<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn contains(&self, linestring: &LineString<T>) -> bool
[src]
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Contains<Line<T>> for LineString<T> where
T: Float,
[src]
T: Float,
fn contains(&self, line: &Line<T>) -> bool
[src]
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Contains<Line<T>> for Polygon<T> where
T: Float,
[src]
T: Float,
fn contains(&self, line: &Line<T>) -> bool
[src]
Checks if the geometry A is completely inside the B geometry. Read more
impl<T> Intersects<Point<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, p: &Point<T>) -> bool
[src]
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<Line<T>> for Point<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, line: &Line<T>) -> bool
[src]
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<Line<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, line: &Line<T>) -> bool
[src]
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<LineString<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, linestring: &LineString<T>) -> bool
[src]
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<Line<T>> for LineString<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, line: &Line<T>) -> bool
[src]
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<Polygon<T>> for Line<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, p: &Polygon<T>) -> bool
[src]
Checks if the geometry A intersects the geometry B. Read more
impl<T> Intersects<Line<T>> for Polygon<T> where
T: Float,
[src]
T: Float,
fn intersects(&self, line: &Line<T>) -> bool
[src]
Checks if the geometry A intersects the geometry B. Read more
impl<T> Area<T> for Line<T> where
T: Float,
[src]
T: Float,
impl<T> Length<T> for Line<T> where
T: Float,
[src]
T: Float,
impl<T> Distance<T, Point<T>> for Line<T> where
T: Float,
[src]
T: Float,
impl<T> Distance<T, Line<T>> for Point<T> where
T: Float,
[src]
T: Float,
impl<T> BoundingBox<T> for Line<T> where
T: CoordinateType,
[src]
T: CoordinateType,
type Output = Bbox<T>
fn bbox(&self) -> Self::Output
[src]
Return the Bounding Box of a geometry Read more
impl<T> Rotate<T> for Line<T> where
T: Float,
[src]
T: Float,
fn rotate(&self, angle: T) -> Self
[src]
Rotate a Geometry around its centroid by an angle, in degrees Read more
impl<T: CoordinateType, NT: CoordinateType> MapCoords<T, NT> for Line<T>
[src]
type Output = Line<NT>
fn map_coords(&self, func: &Fn(&(T, T)) -> (NT, NT)) -> Self::Output
[src]
Apply a function to all the coordinates in a geometric object, returning a new object. Read more
impl<T: CoordinateType> MapCoordsInplace<T> for Line<T>
[src]
fn map_coords_inplace(&mut self, func: &Fn(&(T, T)) -> (T, T))
[src]
Apply a function to all the coordinates in a geometric object, in place Read more
impl<F: Float> ClosestPoint<F> for Line<F>
[src]
fn closest_point(&self, p: &Point<F>) -> Closest<F>
[src]
Find the closest point between self
and p
.
impl ToPostgis<LineString> for Line<f64>
[src]
fn to_postgis_with_srid(&self, srid: Option<i32>) -> LineString
[src]
Converts this geometry to a PostGIS type, using the supplied SRID.
fn to_postgis_wgs84(&self) -> T
[src]
Converts this WGS84 geometry to a PostGIS type.
impl<T> HaversineLength<T> for Line<T> where
T: Float + FromPrimitive,
[src]
T: Float + FromPrimitive,
fn haversine_length(&self) -> T
[src]
Calculation of the length of a Line Read more