Package org.geotools.geometry.jts
Class OffsetCurveBuilder
- Object
-
- OffsetCurveBuilder
-
public class OffsetCurveBuilder extends Object
Builds a offset curve, that is, a line parallel to the provided geometry at a given distance. An offset curve is not the same as a buffer, the line is built only on one side of the original geometry, and will self intersect if the original geometry does the same.- Author:
- Andrea Aime - GeoSolutions
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_THRESHOLD_RATIO
static int
QUADRANT_SEGMENTS_DEFAULT
-
Constructor Summary
Constructors Constructor Description OffsetCurveBuilder(double offset)
Creates an offset builder with the given offset and the default number of quadrant segmentsQUADRANT_SEGMENTS_DEFAULT
OffsetCurveBuilder(double offset, int quadrantSegments)
Creates an offset builder with the given offset and number of quadrant segments
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Geometry
offset(Geometry g)
Builds and return the perpendicular offset geometry.
-
-
-
Constructor Detail
-
OffsetCurveBuilder
public OffsetCurveBuilder(double offset)
Creates an offset builder with the given offset and the default number of quadrant segmentsQUADRANT_SEGMENTS_DEFAULT
- Parameters:
offset
- The offset distance. The offset line will be on the left for positive values, on the right otherwise
-
OffsetCurveBuilder
public OffsetCurveBuilder(double offset, int quadrantSegments)
Creates an offset builder with the given offset and number of quadrant segments- Parameters:
offset
- The offset distance. The offset line will be on the left for positive values, on the right otherwisequadrantSegments
- The number of segments per quadrant, must be positive
-
-
Method Detail
-
offset
public Geometry offset(Geometry g)
Builds and return the perpendicular offset geometry. Only the linestring elements in the input geometries will be subject to offset, the returned geometry will be either a LineString or a MultiLineString- Parameters:
g
- The source geometry- Returns:
- The offset geometry (a single linestring for single line inputs, a multi-linestring for multi-line inputs), or null if no offset geometry could be computed (e.g. the input geometry is made of points)
-
-