Package org.locationtech.jts.algorithm
Class InteriorPoint
- java.lang.Object
-
- org.locationtech.jts.algorithm.InteriorPoint
-
public class InteriorPoint extends java.lang.Object
Computes an interior point of a
. An interior point is guaranteed to lie in the interior of the Geometry, if it possible to calculate such a point exactly. Otherwise, the point may lie on the boundary of the geometry. For collections the interior point is computed for the collection of non-empty elements of highest dimension. The interior point of an empty geometry isGeometry
null
.Algorithm
The point is chosen to be "close to the center" of the geometry. The location depends on the dimension of the input:- Dimension 2 - the interior point is constructed in the middle of the longest interior segment of a line bisecting the area.
- Dimension 1 - the interior point is the interior or boundary vertex closest to the centroid.
- Dimension 0 - the point is the point closest to the centroid.
- See Also:
Centroid
,MaximumInscribedCircle
,LargestEmptyCircle
-
-
Constructor Summary
Constructors Constructor Description InteriorPoint()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Coordinate
getInteriorPoint(Geometry geom)
Computes a location of an interior point in aGeometry
.
-
-
-
Method Detail
-
getInteriorPoint
public static Coordinate getInteriorPoint(Geometry geom)
Computes a location of an interior point in aGeometry
. Handles all geometry types.- Parameters:
geom
- a geometry in which to find an interior point- Returns:
- the location of an interior point,
or
null
if the input is empty
-
-