Skip to main content

Module area

Module area 

Source
Expand description

area(&g) — see boost/geometry/algorithms/area.hpp.

Cartesian-only in v1; spherical / geographic area strategies arrive alongside the Haversine / Andoyer / Vincenty work in later tasks.

§Why four entry points

Boost overloads on the same name area and resolves the right per-tag dispatch::area arm at the call site (algorithms/area.hpp:149-187). Rust has no overloading, and the Cartesian strategy in geometry-strategy::area is intentionally split into four sibling unit-structs (one per geometry kind) to sidestep coherence — see that module’s docs. The split is reflected here as four entry points keyed on the input geometry’s kind; the names follow the same <kind>_area shape that length / perimeter already use for the same reason (crates/geometry-algorithm/src/length.rs).

Functions§

area
Signed area of a Polygon: exterior-ring area plus the sum of interior-ring areas (interior rings are conventionally wound opposite the exterior, so their signed area already cancels).
area_with
Area of a polygon using an explicitly supplied strategy.
box_area
Area of an axis-aligned Box: (xmax - xmin) * (ymax - ymin).
multi_polygon_area
Signed area of a MultiPolygon: sum of the signed areas of its member polygons.
ring_area
Signed area of a Ring via the Cartesian shoelace formula.