Package org.locationtech.jts.jump.geom
Class InteriorPointFinder
- java.lang.Object
-
- org.locationtech.jts.jump.geom.InteriorPointFinder
-
public class InteriorPointFinder extends 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)
-
-
Constructor Summary
Constructors Constructor Description InteriorPointFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.locationtech.jts.geom.Coordinate
centre(org.locationtech.jts.geom.Envelope envelope)
Returns the centre-of-mass of the envelope.protected org.locationtech.jts.geom.Geometry
envelopeMiddle(org.locationtech.jts.geom.Geometry geometry)
org.locationtech.jts.geom.Coordinate
findPoint(org.locationtech.jts.geom.Geometry geometry)
Finds a reasonable point at which to label a Geometry.protected org.locationtech.jts.geom.Geometry
widestGeometry(org.locationtech.jts.geom.Geometry geometry)
-
-
-
Method Detail
-
findPoint
public org.locationtech.jts.geom.Coordinate findPoint(org.locationtech.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 org.locationtech.jts.geom.Geometry widestGeometry(org.locationtech.jts.geom.Geometry geometry)
-
envelopeMiddle
protected org.locationtech.jts.geom.Geometry envelopeMiddle(org.locationtech.jts.geom.Geometry geometry)
-
centre
public org.locationtech.jts.geom.Coordinate centre(org.locationtech.jts.geom.Envelope envelope)
Returns the centre-of-mass of the envelope.- Parameters:
envelope
- the envelope to analyze- Returns:
- the centre of the envelope
-
-