Class InteriorPointLine

java.lang.Object
org.locationtech.jts.algorithm.InteriorPointLine

public class InteriorPointLine extends Object
Computes a point in the interior of an linear geometry.

Algorithm

  • Find an interior vertex which is closest to the centroid of the linestring.
  • If there is no interior vertex, find the endpoint which is closest to the centroid.
Version:
1.7
  • Field Details

    • centroid

      private Coordinate centroid
    • minDistance

      private double minDistance
    • interiorPoint

      private Coordinate interiorPoint
  • Constructor Details

    • InteriorPointLine

      public InteriorPointLine(Geometry g)
  • Method Details

    • getInteriorPoint

      public Coordinate getInteriorPoint()
    • addInterior

      private void addInterior(Geometry geom)
      Tests the interior vertices (if any) defined by a linear Geometry for the best inside point. If a Geometry is not of dimension 1 it is not tested.
      Parameters:
      geom - the geometry to add
    • addInterior

      private void addInterior(Coordinate[] pts)
    • addEndpoints

      private void addEndpoints(Geometry geom)
      Tests the endpoint vertices defined by a linear Geometry for the best inside point. If a Geometry is not of dimension 1 it is not tested.
      Parameters:
      geom - the geometry to add
    • addEndpoints

      private void addEndpoints(Coordinate[] pts)
    • add

      private void add(Coordinate point)