[−][src]Trait geo::algorithm::coordinate_position::CoordinatePosition
Determine whether a Coordinate
lies inside, outside, or on the boundary of a geometry.
Examples
use geo::{polygon, Coordinate}; use geo::coordinate_position::{CoordinatePosition, CoordPos}; let square_poly = polygon![(x: 0.0, y: 0.0), (x: 2.0, y: 0.0), (x: 2.0, y: 2.0), (x: 0.0, y: 2.0), (x: 0.0, y: 0.0)]; let inside_coord = Coordinate { x: 1.0, y: 1.0 }; assert_eq!(square_poly.coordinate_position(&inside_coord), CoordPos::Inside); let boundary_coord = Coordinate { x: 0.0, y: 1.0 }; assert_eq!(square_poly.coordinate_position(&boundary_coord), CoordPos::OnBoundary); let outside_coord = Coordinate { x: 5.0, y: 5.0 }; assert_eq!(square_poly.coordinate_position(&outside_coord), CoordPos::Outside);
Associated Types
Loading content...Required methods
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<Self::Scalar>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<Self::Scalar>,
is_inside: &mut bool,
boundary_count: &mut usize
)
Provided methods
pub fn coordinate_position(&self, coord: &Coordinate<Self::Scalar>) -> CoordPos
[src]
Implementors
impl<T> CoordinatePosition for Geometry<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for Coordinate<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
impl<T> CoordinatePosition for GeometryCollection<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for Line<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for LineString<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for MultiLineString<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for MultiPoint<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
impl<T> CoordinatePosition for MultiPolygon<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for Point<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
_boundary_count: &mut usize
)
impl<T> CoordinatePosition for Polygon<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for Rect<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
impl<T> CoordinatePosition for Triangle<T> where
T: HasKernel,
[src]
T: HasKernel,
type Scalar = T
pub fn calculate_coordinate_position(
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)
[src]
&self,
coord: &Coordinate<T>,
is_inside: &mut bool,
boundary_count: &mut usize
)