public class TaggedLineStringSimplifier
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private double |
distanceTolerance |
private LineSegmentIndex |
inputIndex |
private LineIntersector |
li |
private TaggedLineString |
line |
private Coordinate[] |
linePts |
private LineSegmentIndex |
outputIndex |
| Constructor and Description |
|---|
TaggedLineStringSimplifier(LineSegmentIndex inputIndex,
LineSegmentIndex outputIndex) |
| Modifier and Type | Method and Description |
|---|---|
private int |
findFurthestPoint(Coordinate[] pts,
int i,
int j,
double[] maxDistance) |
private LineSegment |
flatten(int start,
int end)
Flattens a section of the line between
indexes
start and end,
replacing them with a line between the endpoints. |
private boolean |
hasBadInputIntersection(TaggedLineString parentLine,
int[] sectionIndex,
LineSegment candidateSeg) |
private boolean |
hasBadIntersection(TaggedLineString parentLine,
int[] sectionIndex,
LineSegment candidateSeg) |
private boolean |
hasBadOutputIntersection(LineSegment candidateSeg) |
private boolean |
hasInteriorIntersection(LineSegment seg0,
LineSegment seg1) |
private static boolean |
isInLineSection(TaggedLineString line,
int[] sectionIndex,
TaggedLineSegment seg)
Tests whether a segment is in a section of a TaggedLineString
|
private void |
remove(TaggedLineString line,
int start,
int end)
Remove the segs in the section of the line
|
void |
setDistanceTolerance(double distanceTolerance)
Sets the distance tolerance for the simplification.
|
(package private) void |
simplify(TaggedLineString line)
Simplifies the given
TaggedLineString
using the distance tolerance specified. |
private void |
simplifySection(int i,
int j,
int depth) |
private LineIntersector li
private LineSegmentIndex inputIndex
private LineSegmentIndex outputIndex
private TaggedLineString line
private Coordinate[] linePts
private double distanceTolerance
public TaggedLineStringSimplifier(LineSegmentIndex inputIndex, LineSegmentIndex outputIndex)
public void setDistanceTolerance(double distanceTolerance)
distanceTolerance - the approximation tolerance to usevoid simplify(TaggedLineString line)
TaggedLineString
using the distance tolerance specified.line - the linestring to simplifyprivate void simplifySection(int i,
int j,
int depth)
private int findFurthestPoint(Coordinate[] pts, int i, int j, double[] maxDistance)
private LineSegment flatten(int start, int end)
start and end,
replacing them with a line between the endpoints.
The input and output indexes are updated
to reflect this.start - the start index of the flattened sectionend - the end index of the flattened sectionprivate boolean hasBadIntersection(TaggedLineString parentLine, int[] sectionIndex, LineSegment candidateSeg)
private boolean hasBadOutputIntersection(LineSegment candidateSeg)
private boolean hasBadInputIntersection(TaggedLineString parentLine, int[] sectionIndex, LineSegment candidateSeg)
private static boolean isInLineSection(TaggedLineString line, int[] sectionIndex, TaggedLineSegment seg)
line - sectionIndex - seg - private boolean hasInteriorIntersection(LineSegment seg0, LineSegment seg1)
private void remove(TaggedLineString line, int start, int end)
line - pts - sectionStartIndex - sectionEndIndex -