pub fn centroid_first_interior_point(geom: &Geometry<f64>) -> Option<Coord<f64>>Expand description
Computes a representative point of a geometry, preferring its centroid.
Returns the centroid when it lies inside geom, otherwise whatever
interior_point returns, or None if the input is empty. The signature is
interior_point’s, so a caller swaps one call for the other. Which of the
two branches produced the point is not reported: a caller that needs to know
can compare the result against a centroid it computes itself.
Dimensions other than 2 delegate without computing a centroid at all. The check could not pass there — the locator answers EXTERIOR for every point against a puntal or lineal geometry, including that geometry’s own vertices — so computing a centroid only to discard it would be pure waste.
The predicate calls the locator directly rather than going through
verify_interior_point: at dimension 2 that function is this same locator
call plus a mapping onto its outcome enum, and it would also accept a point
on the boundary, which this function does not.