Skip to main content

interior_point

Function interior_point 

Source
pub fn interior_point(geom: &Geometry<f64>) -> Option<Coord<f64>>
Expand description

Computes a location of an interior point in a Geometry. Handles all geometry types.

For collections, the interior point is computed for the collection of non-empty elements of highest dimension:

  • Dimension 2 (Polygon/MultiPolygon) — the point is in the interior of the widest scan-line section.
  • Dimension 1 (LineString/MultiLineString) — the point is the interior vertex closest to the centroid.
  • Dimension 0 (Point/MultiPoint) — the point is the point closest to the centroid.

Returns the location of an interior point, or None if the input is empty.

@jts InteriorPoint#getInteriorPoint(Geometry) @jts-deviate module-level name — get_interior_point would collide with the same static factory in the other three modules.