getLocationWithResolver method
Compute the {@link LinearLocation} corresponding to a length. Negative lengths are measured in reverse from end of the linear geometry. Out-of-range values are clamped. Ambiguous indexes are resolved to the lowest or highest possible location value, depending on the value of resolveLower
@param length the length index @return the corresponding LinearLocation
Implementation
LinearLocation getLocationWithResolver(double length, bool resolveLower) {
double forwardLength = length;
// negative values are measured from end of geometry
if (length < 0.0) {
double lineLen = linearGeom.getLength();
forwardLength = lineLen + length;
}
LinearLocation loc = getLocationForward(forwardLength);
if (resolveLower) {
return loc;
}
return resolveHigher(loc);
}