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