Package org.locationtech.jts.algorithm
Class InteriorPointLine
- java.lang.Object
-
- org.locationtech.jts.algorithm.InteriorPointLine
-
public class InteriorPointLine extends java.lang.ObjectComputes 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 Summary
Fields Modifier and Type Field Description private Coordinatecentroidprivate CoordinateinteriorPointprivate doubleminDistance
-
Constructor Summary
Constructors Constructor Description InteriorPointLine(Geometry g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidadd(Coordinate point)private voidaddEndpoints(Coordinate[] pts)private voidaddEndpoints(Geometry geom)Tests the endpoint vertices defined by a linear Geometry for the best inside point.private voidaddInterior(Coordinate[] pts)private voidaddInterior(Geometry geom)Tests the interior vertices (if any) defined by a linear Geometry for the best inside point.CoordinategetInteriorPoint()
-
-
-
Field Detail
-
centroid
private Coordinate centroid
-
minDistance
private double minDistance
-
interiorPoint
private Coordinate interiorPoint
-
-
Constructor Detail
-
InteriorPointLine
public InteriorPointLine(Geometry g)
-
-
Method Detail
-
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)
-
-