pub trait Distance<F, Origin, Destination> {
// Required method
fn distance(origin: Origin, destination: Destination) -> F;
}
Expand description
Calculate the minimum distance between two geometries.
Required Methods§
Sourcefn distance(origin: Origin, destination: Destination) -> F
fn distance(origin: Origin, destination: Destination) -> F
Note that not all implementations support all geometry combinations, but at least Point
to Point
is supported.
See specific implementations for details.
§Units
origin
,destination
: geometry where the units of x/y depend on the trait implementation.- returns: depends on the trait implementation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl Distance<f64, Point, Point> for Geodesic
impl<F> Distance<F, &Geometry<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &Line<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &LineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &Point<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &Polygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &Rect<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Geometry<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &GeometryCollection<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &GeometryCollection<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &GeometryCollection<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &Point<F>> for Euclideanwhere
F: CoordFloat,
impl<F> Distance<F, &Line<F>, &Rect<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Line<F>, Coord<F>> for Euclideanwhere
F: CoordFloat,
impl<F> Distance<F, &LineString<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &Line<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &Point<F>> for Euclideanwhere
F: CoordFloat,
impl<F> Distance<F, &LineString<F>, &Rect<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &LineString<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &MultiLineString<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &MultiPolygon<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &MultiPolygon<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Point<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Point<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Point<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Point<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Point<F>, &Rect<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Point<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &Line<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &LineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &Point<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &Rect<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Polygon<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Rect<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Rect<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Rect<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Rect<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Rect<F>, &Triangle<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Triangle<F>, &GeometryCollection<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Triangle<F>, &MultiLineString<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Triangle<F>, &MultiPoint<F>> for Euclideanwhere
F: GeoFloat,
impl<F> Distance<F, &Triangle<F>, &MultiPolygon<F>> for Euclideanwhere
F: GeoFloat,
impl<F: CoordFloat + FromPrimitive> Distance<F, Point<F>, Point<F>> for Haversine
impl<F: CoordFloat + FromPrimitive> Distance<F, Point<F>, Point<F>> for Rhumb
impl<F: CoordFloat> Distance<F, &Point<F>, &Line<F>> for Euclidean
impl<F: CoordFloat> Distance<F, &Point<F>, &LineString<F>> for Euclidean
impl<F: CoordFloat> Distance<F, &Point<F>, &Point<F>> for Euclidean
impl<F: CoordFloat> Distance<F, Coord<F>, &Line<F>> for Euclidean
impl<F: CoordFloat> Distance<F, Coord<F>, Coord<F>> for Euclidean
impl<F: CoordFloat> Distance<F, Point<F>, Point<F>> for Euclidean
Calculate the Euclidean distance (a.k.a. pythagorean distance) between two Points