Skip to main content

Crate geometry_algorithm

Crate geometry_algorithm 

Source
Expand description

Free-function algorithm entry points users actually call.

Each function mirrors the matching free function in boost/geometry/algorithms/. Strategy-driven algorithms expose a strategy-less default plus a _with explicit-strategy companion. Algorithms that require the overlay engine live in geometry-overlay to preserve the workspace’s one-way dependency graph.

§References

  • boost/geometry/algorithms/
  • boost/geometry/algorithms/detail/

Re-exports§

pub use append::append;
pub use append::append_to_ring;
pub use area::area;
pub use area::area_with;
pub use area::box_area;
pub use area::multi_polygon_area;
pub use area::ring_area;
pub use assign::assign_values;
pub use azimuth::azimuth;
pub use azimuth::azimuth_with;
pub use centroid::centroid;
pub use centroid::centroid_with;
pub use chaikin_smoothing::chaikin_smoothing;
pub use clear::clear;
pub use closest_points::closest_points;
pub use closest_points::closest_points_with;
pub use concave_hull::ConcaveHullParams;
pub use concave_hull::concave_hull;
pub use concave_hull::concave_hull_with;
pub use concave_hull::k_nearest_concave_hull;
pub use convert::convert;
pub use convex_hull::convex_hull;
pub use coordinate_position::CoordinatePosition;
pub use coordinate_position::coordinate_position;
pub use correct::correct;
pub use correct::correct_closure;
pub use densify::densify;
pub use destination::destination;
pub use destination::destination_with;
pub use discrete_frechet::discrete_frechet_distance;
pub use discrete_frechet::discrete_frechet_distance_with;
pub use discrete_hausdorff::discrete_hausdorff_distance;
pub use discrete_hausdorff::discrete_hausdorff_distance_with;
pub use disjoint::disjoint;
pub use disjoint::disjoint_box_box;
pub use distance::comparable_distance;
pub use distance::comparable_distance_with;
pub use distance::distance;
pub use distance::distance_with;
pub use envelope::envelope;
pub use equals::equals;
pub use expand::expand;
pub use expand::expand_with;
pub use for_each::for_each_point;
pub use for_each::for_each_segment;
pub use intersects::intersects;
pub use intersects::intersects_reversed;
pub use is_convex::is_convex;
pub use is_empty::is_empty;
pub use is_simple::is_simple;
pub use length::length;
pub use length::length_with;
pub use length::perimeter;
pub use length::perimeter_with;
pub use length::ring_perimeter;
pub use length::ring_perimeter_with;
pub use line_interpolate::line_interpolate;
pub use line_locate_point::line_locate_point;
pub use linestring_segmentize::linestring_segmentize;
pub use linestring_segmentize::linestring_segmentize_with;
pub use make::make_box;
pub use make::make_point;
pub use make::make_segment;
pub use map_coords::map_coords;
pub use map_coords::map_coords_in_place;
pub use minimum_rotated_rect::minimum_rotated_rect;
pub use monotone_subdivision::monotone_subdivision;
pub use num_geometries::num_geometries;
pub use num_interior_rings::num_interior_rings;
pub use num_points::num_points;
pub use num_segments::num_segments;
pub use remove_spikes::remove_spikes;
pub use reverse::reverse;
pub use rhumb::rhumb_azimuth;
pub use rhumb::rhumb_azimuth_with;
pub use rhumb::rhumb_destination;
pub use rhumb::rhumb_destination_with;
pub use rhumb::rhumb_distance;
pub use rhumb::rhumb_distance_with;
pub use rhumb::rhumb_length;
pub use rhumb::rhumb_length_with;
pub use simplify::simplify;
pub use simplify::simplify_with;
pub use transform::transform;
pub use triangulate_earcut::triangulate_earcut;
pub use unique::unique;
pub use within::covered_by;
pub use within::within;

Modules§

append
append(&mut g, point) and the ring-index variant.
area
area(&g) — see boost/geometry/algorithms/area.hpp.
assign
Write coordinates into a mutable geometry.
azimuth
azimuth(&p1, &p2) — the bearing from p1 to p2.
centroid
centroid(&g) — the geometric centre of g.
chaikin_smoothing
Chaikin corner-cutting smoothing.
clear
clear(&mut g) — empty the backing storage in place.
closest_points
closest_points(&a, &b) -> (Point, Point) — nearest-point pair.
concave_hull
Concave hulls derived from a planar point set.
convert
convert(src) -> Dst — typed conversions between equivalent geometry kinds.
convex_hull
convex_hull(&g) -> Ring<G::Point> — minimal enclosing ring.
coordinate_position
Tri-state point-in-geometry classification.
correct
correct(&mut g) — fix ring closure and orientation in place.
densify
densify(g, max_distance) — insert intermediate points so no segment exceeds max_distance.
destination
Point at a bearing and distance from an angular-coordinate point.
discrete_frechet
discrete_frechet_distance(&l1, &l2) — DP table over the two point sequences.
discrete_hausdorff
discrete_hausdorff_distance(&l1, &l2) — sup-sup distance over vertex sets.
disjoint
disjoint(&a, &b) — see boost/geometry/algorithms/disjoint.hpp.
distance
User-facing distance / distance_with / comparable_distance entry points.
envelope
envelope(&g) — the axis-aligned bounding box of g.
equals
equals(&a, &b) — see boost/geometry/algorithms/equals.hpp.
expand
Expand a box to include another geometry.
for_each
Geometry visitors — for_each_point and for_each_segment.
intersects
intersects(&a, &b) — see boost/geometry/algorithms/intersects.hpp.
is_convex
is_convex(&g) -> bool.
is_empty
is_empty(&g) — true iff num_points(g) == 0.
is_simple
is_simple(&g) -> bool — OGC Simple Feature predicate.
length
length(&g) and perimeter(&p) — see boost/geometry/algorithms/{length,perimeter}.hpp.
line_interpolate
line_interpolate(ls, t) -> Point — point at fractional arc-length t ∈ [0, 1] along ls.
line_locate_point
Locate the closest point as a fraction of Cartesian linestring length.
linestring_segmentize
Split a linestring into equal-length pieces.
make
Construct a Point / Box / Segment from a coordinate slice.
map_coords
Coordinate mapping for the stock geometry models.
minimum_rotated_rect
Minimum-area rotated rectangle around a planar geometry.
monotone_subdivision
Y-monotone subdivision of a Cartesian polygon.
num_geometries
num_geometries(&g) — number of distinct geometries in g.
num_interior_rings
num_interior_rings(&g) — Σ interior-ring counts.
num_points
num_points(&g) — total point count, recursive on multi / polygon kinds.
num_segments
num_segments(&g) — total edge count.
remove_spikes
remove_spikes(&mut g) — drop collinear-and-reversed vertices.
reverse
reverse(&mut g) — flip point order in place.
rhumb
Named rhumb-line measurement entries.
simplify
simplify(g, max_distance) — return a Douglas–Peucker-simplified copy of g.
transform
transform(&g, &strategy) — return a fresh geometry whose every point has been mapped through strategy.
triangulate_earcut
Native ear-clipping triangulation for Cartesian polygons.
unique
unique(&mut g) — collapse consecutive duplicate points.
within
within(&p, &g) / covered_by(&p, &g) — point-in-geometry containment, see boost/geometry/algorithms/within.hpp and boost/geometry/algorithms/covered_by.hpp.

Structs§

DynKindMismatch
Returned by _dyn wrappers when the input combination has no static algorithm impl.

Functions§

area_dyn
Runtime-dispatched signed area.
distance_dyn
Runtime-dispatched distance.
envelope_dyn
Runtime-dispatched envelope.
length_dyn
Runtime-dispatched length.
within_dyn
Runtime-dispatched point-in-polygon.