: intersectionPoint;
// split the line at the intersection point
Geometry difference = original.difference(trimmingLine);
LineString splitLine1;
LineString splitLine2;
if (difference instanceof MultiLineString) {
splitLine1 = (LineString) difference.getGeometryN(0);
splitLine2 = (LineString) difference.getGeometryN(1);
} else if (difference instanceof LineString) {
// original touches trimmingLine but does not crosses it
splitLine1 = (LineString) difference;
splitLine2 = difference.getFactory().createLineString(new Coordinate[0]);
} else {
throw new IllegalStateException(Messages.TrimGeometryStrategy_difference_unknown_type + difference);
}
Coordinate firstLinePoint = getCoordinateBeforePoint(splitLine1, intersectionPoint);
if (firstLinePoint.equals2D(intersectionPoint)) {
// same case as the comment for line1, or computeOrientation will
// return COLLINEAR,
// and we'll have no way to tell wether the line is at the right or
// the left
firstLinePoint = splitLine1.getCoordinateN(1);
}
final int firstLineOrientation = CGAlgorithms.computeOrientation(lineFrom, lineTo, firstLinePoint);
LineString lineAtTheRight;
// return the segment at the left of the intersection point
if (CGAlgorithms.CLOCKWISE == firstLineOrientation) {
lineAtTheRight = splitLine2;
} else {