Package org.locationtech.jts.algorithm
Class InteriorPointArea
- java.lang.Object
-
- org.locationtech.jts.algorithm.InteriorPointArea
-
public class InteriorPointArea extends java.lang.Object
Computes a point in the interior of an areal geometry.Algorithm
- Find a Y value which is close to the centre of the geometry's vertical extent but is different to any of it's Y ordinates.
- Create a horizontal bisector line using the Y value and the geometry's horizontal extent
- Find the intersection between the geometry and the horizontal bisector line. The intersection is a collection of lines and points.
- Pick the midpoint of the largest intersection geometry
KNOWN BUGS
- If a fixed precision model is used, in some cases this method may return a point which does not lie in the interior.
- Version:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description InteriorPointArea(Geometry g)
Creates a new interior point finder for an areal geometry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Coordinate
centre(Envelope envelope)
Returns the centre point of the envelope.Coordinate
getInteriorPoint()
Gets the computed interior point.
-
-
-
Constructor Detail
-
InteriorPointArea
public InteriorPointArea(Geometry g)
Creates a new interior point finder for an areal geometry.- Parameters:
g
- an areal geometry
-
-
Method Detail
-
getInteriorPoint
public Coordinate getInteriorPoint()
Gets the computed interior point.- Returns:
- the coordinate of an interior point
-
centre
public static Coordinate centre(Envelope envelope)
Returns the centre point of the envelope.- Parameters:
envelope
- the envelope to analyze- Returns:
- the centre of the envelope
-
-