Class InteriorPointFinder

java.lang.Object
com.vividsolutions.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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InteriorPointFinder

      public InteriorPointFinder()
  • Method Details

    • 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)