BufferInputLineSimplifier class

Simplifies a buffer input line to remove concavities with shallow depth.

The most important benefit of doing this is to reduce the number of points and the complexity of shape which will be buffered. It also reduces the risk of gores created by the quantized fillet arcs (although this issue should be eliminated in any case by the offset curve generation logic).

A key aspect of the simplification is that it affects inside (concave or inward) corners only. Convex (outward) corners are preserved, since they are required to ensure that the generated buffer curve lies at the correct distance from the input geometry.

Another important heuristic used is that the end segments of the input are never simplified. This ensures that the client buffer code is able to generate end caps faithfully.

No attempt is made to avoid self-intersections in the output. This is acceptable for use for generating a buffer offset curve, since the buffer algorithm is insensitive to invalid polygonal geometry. However, this means that this algorithm cannot be used as a general-purpose polygon simplification technique.

@author Martin Davis

Constructors

BufferInputLineSimplifier(List<Coordinate> inputLine)

Properties

angleOrientation int
getter/setter pair
distanceTol double
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inputLine List<Coordinate>
getter/setter pair
isDeleted List<int>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

collapseLine() List<Coordinate>
deleteShallowConcavities() bool
Uses a sliding window containing 3 vertices to detect shallow angles in which the middle vertex can be deleted, since it does not affect the shape of the resulting buffer in a significant way. @return
findNextNonDeletedIndex(int index) int
Finds the next non-deleted index, or the end of the point array if none @param index @return the next non-deleted index, if any or inputLine.length if there are no more non-deleted indices
isConcave(Coordinate p0, Coordinate p1, Coordinate p2) bool
isDeletable(int i0, int i1, int i2, double distanceTol) bool
isShallow(Coordinate p0, Coordinate p1, Coordinate p2, double distanceTol) bool
isShallowConcavity(Coordinate p0, Coordinate p1, Coordinate p2, double distanceTol) bool
isShallowSampled(Coordinate p0, Coordinate p2, int i0, int i2, double distanceTol) bool
Checks for shallowness over a sample of points in the given section. This helps prevents the simplification from incrementally "skipping" over points which are in fact non-shallow.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
simplifyWithTol(double distanceTol) List<Coordinate>
Simplify the input coordinate list. If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

DELETE int
final
INIT int
final
KEEP int
final
NUM_PTS_TO_CHECK int
final

Static Methods

simplify(List<Coordinate> inputLine, double distanceTol) List<Coordinate>
Simplify the input coordinate list. If the distance tolerance is positive, concavities on the LEFT side of the line are simplified. If the supplied distance tolerance is negative, concavities on the RIGHT side of the line are simplified.