Class OffsetPointGenerator
- java.lang.Object
-
- org.locationtech.jts.operation.overlay.validate.OffsetPointGenerator
-
public class OffsetPointGenerator extends java.lang.Object
Generates points offset by a given distance from both sides of the midpoint of all segments in aGeometry
. Can be used to generate probe points for determining whether a polygonal overlay result is incorrect. The input geometry may have any orientation for its rings, butsetSidesToGenerate(boolean, boolean)
is only meaningful if the orientation is known.- Version:
- 1.7
-
-
Constructor Summary
Constructors Constructor Description OffsetPointGenerator(Geometry g)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
computeOffsetPoints(Coordinate p0, Coordinate p1, double offsetDistance, java.util.List offsetPts)
Generates the two points which are offset from the midpoint of the segment (p0, p1) by the offsetDistance.private void
extractPoints(LineString line, double offsetDistance, java.util.List offsetPts)
java.util.List
getPoints(double offsetDistance)
Gets the computed offset points.void
setSidesToGenerate(boolean doLeft, boolean doRight)
Set the sides on which to generate offset points.
-
-
-
Field Detail
-
g
private Geometry g
-
doLeft
private boolean doLeft
-
doRight
private boolean doRight
-
-
Constructor Detail
-
OffsetPointGenerator
public OffsetPointGenerator(Geometry g)
-
-
Method Detail
-
setSidesToGenerate
public void setSidesToGenerate(boolean doLeft, boolean doRight)
Set the sides on which to generate offset points.- Parameters:
doLeft
-doRight
-
-
getPoints
public java.util.List getPoints(double offsetDistance)
Gets the computed offset points.- Returns:
- List<Coordinate>
-
extractPoints
private void extractPoints(LineString line, double offsetDistance, java.util.List offsetPts)
-
computeOffsetPoints
private void computeOffsetPoints(Coordinate p0, Coordinate p1, double offsetDistance, java.util.List offsetPts)
Generates the two points which are offset from the midpoint of the segment (p0, p1) by the offsetDistance.- Parameters:
p0
- the first point of the segment to offset fromp1
- the second point of the segment to offset from
-
-