BufferCurveSetBuilder class
Creates all the raw offset curves for a buffer of a {@link Geometry}. Raw curves need to be noded together and polygonized to form the final buffer area.
@version 1.7
Constructors
- BufferCurveSetBuilder(Geometry inputGeom, double distance, PrecisionModel precisionModel, BufferParameters bufParams)
Properties
- curveBuilder ↔ OffsetCurveBuilder?
-
getter/setter pair
- curveList ↔ List
-
getter/setter pair
- distance ↔ double
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- inputGeom ↔ Geometry
-
getter/setter pair
- isInvertOrientation ↔ bool
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
Geometry g) → void -
addCollection(
GeometryCollection gc) → void -
addCurve(
List< Coordinate> ? coord, int leftLoc, int rightLoc) → void -
Creates a {@link SegmentString} for a coordinate list which is a raw offset curve,
and adds it to the list of buffer curves.
The SegmentString is tagged with a Label giving the topology of the curve.
The curve may be oriented in either direction.
If the curve is oriented CW, the locations will be:
Left: Location.EXTERIOR
Right: Location.INTERIOR -
addLineString(
LineString line) → void -
addPoint(
Point p) → void - Add a Point to the graph.
-
addPolygon(
Polygon p) → void -
addRingBothSides(
List< Coordinate> coord, double distance) → void -
addRingSide(
List< Coordinate> coord, double offsetDistance, int side, int cwLeftLoc, int cwRightLoc) → void - Adds an offset curve for one side of a ring. The side and left and right topological location arguments are provided as if the ring is oriented CW. (If the ring is in the opposite orientation, this is detected and the left and right locations are interchanged and the side is flipped.)
-
getCurves(
) → List - Computes the set of raw offset curves for the buffer. Each offset curve has an attached {@link Label} indicating its left and right location.
-
isRingCCW(
List< Coordinate> coord) → bool - Computes orientation of a ring using a signed-area orientation test. For invalid (self-crossing) rings this ensures the largest enclosed area is taken to be the interior of the ring. This produces a more sensible result when used for repairing polygonal geometry via buffer-by-zero. For buffer use the lower robustness of orientation-by-area doesn't matter, since narrow or flat rings produce an acceptable offset curve for either orientation.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setInvertOrientation(
bool isInvertOrientation) → void - Sets whether the offset curve is generated using the inverted orientation of input rings. This allows generating a buffer(0) polygon from the smaller lobes of self-crossing rings.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- INVERTED_CURVE_VERTEX_FACTOR → int
-
final
- MAX_INVERTED_RING_SIZE → int
-
final
- NEARNESS_FACTOR → double
-
final
Static Methods
-
clean(
List< Coordinate> coords) → List<Coordinate> - Keeps only valid coordinates, and removes repeated points.
-
isErodedCompletely(
LinearRing ring, double bufferDistance) → bool - Tests whether a ring buffer is eroded completely (is empty) based on simple heuristics.
-
isRingCurveInverted(
List< Coordinate> inputPts, double distance, List<Coordinate> curvePts) → bool - Tests whether the offset curve for a ring is fully inverted. An inverted ("inside-out") curve occurs in some specific situations involving a buffer distance which should result in a fully-eroded (empty) buffer. It can happen that the sides of a small, convex polygon produce offset segments which all cross one another to form a curve with inverted orientation. This happens at buffer distances slightly greater than the distance at which the buffer should disappear. The inverted curve will produce an incorrect non-empty buffer (for a shell) or an incorrect hole (for a hole). It must be discarded from the set of offset curves used in the buffer. Heuristics are used to reduce the number of cases which area checked, for efficiency and correctness.
-
isTriangleErodedCompletely(
List< Coordinate> triangleCoord, double bufferDistance) → bool - Tests whether a triangular ring would be eroded completely by the given buffer distance. This is a precise test. It uses the fact that the inner buffer of a triangle converges on the inCentre of the triangle (the point equidistant from all sides). If the buffer distance is greater than the distance of the inCentre from a side, the triangle will be eroded completely.
-
maxDistance(
List< Coordinate> pts, List<Coordinate> line) → double - Computes the maximum distance out of a set of points to a linestring.