com.vividsolutions.jump.geom
Class InteriorPointFinder

java.lang.Object
  extended by com.vividsolutions.jump.geom.InteriorPointFinder

public class InteriorPointFinder
extends java.lang.Object

Find a reasonable point at which to label a Geometry.

Algorithm is:


Constructor Summary
InteriorPointFinder()
           
 
Method Summary
 com.vividsolutions.jts.geom.Coordinate centre(com.vividsolutions.jts.geom.Envelope envelope)
          Returns the centre-of-mass of the envelope.
 com.vividsolutions.jts.geom.Coordinate findPoint(com.vividsolutions.jts.geom.Geometry geometry)
          Finds a reasonable point at which to label a Geometry.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteriorPointFinder

public InteriorPointFinder()
Method Detail

findPoint

public com.vividsolutions.jts.geom.Coordinate findPoint(com.vividsolutions.jts.geom.Geometry geometry)
Finds a reasonable point at which to label a Geometry.

Parameters:
geometry - the geometry to analyze
Returns:
the midpoint of the largest intersection between the geometry and a line halfway down its envelope

centre

public com.vividsolutions.jts.geom.Coordinate centre(com.vividsolutions.jts.geom.Envelope envelope)
Returns the centre-of-mass of the envelope.

Parameters:
envelope - the envelope to analyze
Returns:
the centre of the envelope