com.vividsolutions.jump.geom
Class InteriorPointFinder
java.lang.Object
com.vividsolutions.jump.geom.InteriorPointFinder
public class InteriorPointFinder
- extends java.lang.Object
Find a reasonable point at which to label a Geometry.
Algorithm is:
- Find the intersections between the geometry and a line halfway
down the envelope
- Pick the midpoint of the largest intersection (the intersections
will be lines and points)
|
Method Summary |
com.vividsolutions.jts.geom.Coordinate |
centre(com.vividsolutions.jts.geom.Envelope envelope)
Returns the centre-of-mass of the envelope. |
protected com.vividsolutions.jts.geom.Geometry |
envelopeMiddle(com.vividsolutions.jts.geom.Geometry geometry)
|
com.vividsolutions.jts.geom.Coordinate |
findPoint(com.vividsolutions.jts.geom.Geometry geometry)
Finds a reasonable point at which to label a Geometry. |
protected com.vividsolutions.jts.geom.Geometry |
widestGeometry(com.vividsolutions.jts.geom.Geometry geometry)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InteriorPointFinder
public InteriorPointFinder()
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
widestGeometry
protected com.vividsolutions.jts.geom.Geometry widestGeometry(com.vividsolutions.jts.geom.Geometry geometry)
envelopeMiddle
protected com.vividsolutions.jts.geom.Geometry envelopeMiddle(com.vividsolutions.jts.geom.Geometry geometry)
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