com.vividsolutions.jts.algorithm
Class InteriorPointArea
java.lang.Object
com.vividsolutions.jts.algorithm.InteriorPointArea
public class InteriorPointArea
extends java.lang.Object
Computes a point in the interior of an area geometry.
Algorithm
- Find the intersections between the geometry
and the horizontal bisector of the area's envelope
- Pick the midpoint of the largest intersection (the intersections
will be lines and points)
Note: If a fixed precision model is used,
in some cases this method may return a point
which does not lie in the interior.
InteriorPointArea
public InteriorPointArea(Geometry g)
addPolygon
public void addPolygon(Geometry geometry)
Finds a reasonable point at which to label a Geometry.
geometry
- the geometry to analyze
centre
public Coordinate centre(Envelope envelope)
Returns the centre point of the envelope.
envelope
- the envelope to analyze
- the centre of the envelope
getInteriorPoint
public Coordinate getInteriorPoint()