public class LineStringCursor extends Object
| Constructor and Description |
|---|
LineStringCursor(LineString ls)
Builds a new cursor
|
LineStringCursor(LineStringCursor cursor)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
double |
getCurrentAngle()
Returns the current segment direction as an angle expressed in radians
|
double |
getCurrentOrdinate() |
Coordinate |
getCurrentPosition()
Returns the Point representing the current position along the LineString
|
Coordinate |
getCurrentPosition(Coordinate c)
Returns the Point representing the current position along the LineString
|
double |
getLabelOrientation()
Returns the current segment direction as an angle expressed in radians
|
LineString |
getLineString()
The linestrings wrapped by this cursor
|
double |
getLineStringLength()
Returns the line string length
|
double |
getMaxAngleChange(double startOrdinate,
double endOrdinate)
Returns the maximum angle change (in radians) between two subsequent segments between the
specified curvilinear coordinates.
|
double |
getMaxAngleChange(double startOrdinate,
double endOrdinate,
double step)
A variant of
getMaxAngleChange(double, double) taking a step and evaluating angle
differences at such step. |
double |
getMaxDistanceFromStraightLine(double startOrdinate,
double endOrdinate)
Returns the maximum distance between the curve and a straight line connecting the start and
end ordinates.
|
protected double |
getSegmentAngle(int segmentIdx) |
LineString |
getSubLineString(double startOrdinate,
double endOrdinate)
Returns the linestring that starts and ends at the specified curvilinear coordinates.
|
boolean |
moveRelative(double offset)
Moves of the specified distance from the current position.
|
void |
moveTo(double ordinate)
Moves the current position to the
|
LineStringCursor |
reverse()
Returns a line string cursor based on the opposite walking direction.
|
public LineStringCursor(LineString ls)
ls - public LineStringCursor(LineStringCursor cursor)
cursor - public double getLineStringLength()
public void moveTo(double ordinate)
ordinate - public boolean moveRelative(double offset)
offset - public Coordinate getCurrentPosition()
public Coordinate getCurrentPosition(Coordinate c)
public double getCurrentOrdinate()
public double getCurrentAngle()
protected double getSegmentAngle(int segmentIdx)
public double getLabelOrientation()
public double getMaxAngleChange(double startOrdinate,
double endOrdinate)
startOrdinate - endOrdinate - public double getMaxAngleChange(double startOrdinate,
double endOrdinate,
double step)
getMaxAngleChange(double, double) taking a step and evaluating angle
differences at such step. This helps when a line has many little segments and chars would end
up showing several segments apart (so the full angle change needs to be considered)startOrdinate - endOrdinate - step - public double getMaxDistanceFromStraightLine(double startOrdinate,
double endOrdinate)
startOrdinate - endOrdinate - public LineStringCursor reverse()
public LineString getLineString()
public LineString getSubLineString(double startOrdinate,
double endOrdinate)
startOrdinate - endOrdinate - Copyright © 1996–2019 Geotools. All rights reserved.