public class MaximumInscribedCircle extends Object
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.
LargestEmptyCircle
,
InteriorPoint
,
Centroid
Constructor and Description |
---|
MaximumInscribedCircle(Geometry polygonal,
double tolerance)
Creates a new instance of a Maximum Inscribed Circle computation.
|
Modifier and Type | Method and Description |
---|---|
Point |
getCenter()
Gets the center point of the maximum inscribed circle
(up to the tolerance distance).
|
static Point |
getCenter(Geometry polygonal,
double tolerance)
Computes the center point of the Maximum Inscribed Circle
of a polygonal geometry, up to a given tolerance distance.
|
LineString |
getRadiusLine()
Gets a line representing a radius of the Largest Empty Circle.
|
static LineString |
getRadiusLine(Geometry polygonal,
double tolerance)
Computes a radius line of the Maximum Inscribed Circle
of a polygonal geometry, up to a given tolerance distance.
|
Point |
getRadiusPoint()
Gets a point defining the radius of the Maximum Inscribed Circle.
|
public MaximumInscribedCircle(Geometry polygonal, double tolerance)
polygonal
- an areal geometrytolerance
- the distance tolerance for computing the centre point (must be positive)IllegalArgumentException
- if the tolerance is non-positive, or the input geometry is non-polygonal or empty.public static Point getCenter(Geometry polygonal, double tolerance)
polygonal
- a polygonal geometrytolerance
- the distance tolerance for computing the center pointpublic static LineString getRadiusLine(Geometry polygonal, double tolerance)
polygonal
- a polygonal geometrytolerance
- the distance tolerance for computing the center pointpublic Point getCenter()
public Point getRadiusPoint()
public LineString getRadiusLine()
Copyright © 2024. All rights reserved.