/** * Creates an iterator starting at a {@link LinearLocation} on a linear {@link Geometry} * * @param linear the linear geometry to iterate over * @param start the location to start at * @throws IllegalArgumentException if linearGeom is not lineal */ public LinearIterator(Geometry linear, LinearLocation start) { this(linear, start.getComponentIndex(), segmentEndVertexIndex(start)); }
private static int segmentEndVertexIndex(LinearLocation loc) { if (loc.getSegmentFraction() > 0.0) return loc.getSegmentIndex() + 1; return loc.getSegmentIndex(); }