Class MaximumInscribedCircle
- Namespace
- NetTopologySuite.Algorithm.Construct
- Assembly
- NetTopologySuite.dll
Constructs the Maximum Inscribed Circle for a polygonal Geometry, up to a specified tolerance. The Maximum Inscribed Circle is determined by a point in the interior of the area which has the farthest distance from the area boundary, along with a boundary point at that distance.
In the context of geography the center of the Maximum Inscribed Circle is known as the Pole of Inaccessibility. A cartographic use case is to determine a suitable point to place a map label within a polygon. The radius length of the Maximum Inscribed Circle is a measure of how "narrow" a polygon is. It is the distance at which the negative buffer becomes empty. The class supports polygons with holes and multipolygons. The implementation uses a successive-approximation technique over a grid of square cells covering the area geometry. The grid is refined using a branch-and-bound algorithm. Point containment and distance are computed in a performant way by using spatial indexes.Future Enhancements
- Support a polygonal constraint on placement of center
public class MaximumInscribedCircle
- Inheritance
-
MaximumInscribedCircle
- Inherited Members
Constructors
MaximumInscribedCircle(Geometry, double)
Creates a new instance of a Maximum Inscribed Circle computation.
public MaximumInscribedCircle(Geometry polygonal, double tolerance)
Parameters
polygonal
GeometryAn areal geometry
tolerance
doubleThe distance tolerance for computing the centre point (must be positive)
Exceptions
- ArgumentOutOfRangeException
Thrown if the tolerance is non-positive
- ArgumentException
Thrown if the input geometry is non-polygonal or empty
Methods
GetCenter()
Gets the center point of the maximum inscribed circle (up to the tolerance distance).
public Point GetCenter()
Returns
- Point
The center point of the maximum inscribed circle
GetCenter(Geometry, double)
Computes the center point of the Maximum Inscribed Circle of a polygonal geometry, up to a given tolerance distance.
public static Point GetCenter(Geometry polygonal, double tolerance)
Parameters
polygonal
GeometryA polygonal geometry
tolerance
doubleThe distance tolerance for computing the center point
Returns
- Point
The center point of the maximum inscribed circle
GetRadiusLine()
Gets a line representing a radius of the Largest Empty Circle.
public LineString GetRadiusLine()
Returns
- LineString
A line from the center of the circle to a point on the edge
GetRadiusLine(Geometry, double)
Computes a radius line of the Maximum Inscribed Circle of a polygonal geometry, up to a given tolerance distance.
public static LineString GetRadiusLine(Geometry polygonal, double tolerance)
Parameters
polygonal
GeometryA polygonal geometry
tolerance
doubleThe distance tolerance for computing the center point
Returns
- LineString
A line from the center to a point on the circle
GetRadiusPoint()
Gets a point defining the radius of the Maximum Inscribed Circle. This is a point on the boundary which is nearest to the computed center of the Maximum Inscribed Circle. The line segment from the center to this point is a radius of the constructed circle, and this point lies on the boundary of the circle.
public Point GetRadiusPoint()
Returns
- Point
A point defining the radius of the Maximum Inscribed Circle