LengthIndexedLine class

Supports linear referencing along a linear {@link Geometry} using the length along the line as the index. Negative length values are taken as measured in the reverse direction from the end of the geometry. Out-of-range index values are handled by clamping them to the valid range of values. Non-simple lines (i.e. which loop back to cross or touch themselves) are supported.

Constructors

LengthIndexedLine(Geometry linearGeom)
Constructs an object which allows a linear {@link Geometry} to be linearly referenced using length as an index.

Properties

hashCode int
The hash code for this object.
no setterinherited
linearGeom Geometry
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clampIndex(double index) double
Computes a valid index for this line by clamping the given index to the valid range of index values
extractLine(double startIndex, double endIndex) Geometry
Computes the {@link LineString} for the interval on the line between the given indices. If the endIndex lies before the startIndex, the computed geometry is reversed.
extractPoint(double index) Coordinate
Computes the {@link Coordinate} for the point on the line at the given index. If the index is out of range the first or last point on the line will be returned. The Z-ordinate of the computed point will be interpolated from the Z-ordinates of the line segment containing it, if they exist.
extractPointWithOffset(double index, double offsetDistance) Coordinate
Computes the {@link Coordinate} for the point on the line at the given index, offset by the given distance. If the index is out of range the first or last point on the line will be returned. The computed point is offset to the left of the line if the offset distance is positive, to the right if negative.
getEndIndex() double
Returns the index of the end of the line @return the end index
getStartIndex() double
Returns the index of the start of the line @return the start index
indexOf(Coordinate pt) double
Computes the minimum index for a point on the line. If the line is not simple (i.e. loops back on itself) a single point may have more than one possible index. In this case, the smallest index is returned.
indexOfAfter(Coordinate pt, double minIndex) double
Finds the index for a point on the line which is greater than the given index. If no such index exists, returns minIndex. This method can be used to determine all indexes for a point which occurs more than once on a non-simple line. It can also be used to disambiguate cases where the given point lies slightly off the line and is equidistant from two different points on the line.
indicesOf(Geometry subLine) List<double>
Computes the indices for a subline of the line. (The subline must conform to the line; that is, all vertices in the subline (except possibly the first and last) must be vertices of the line and occur in the same order).
isValidIndex(double index) bool
Tests whether an index is in the valid index range for the line.
locationOf(double index) LinearLocation
locationOfWithResolver(double index, bool resolveLower) LinearLocation
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
positiveIndex(double index) double
project(Coordinate pt) double
Computes the index for the closest point on the line to the given point. If more than one point has the closest distance the first one along the line is returned. (The point does not necessarily have to lie precisely on the line.)
toString() String
A string representation of this object.
inherited

Operators

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