/** reverses the order of points in lr (is CW -> CCW or CCW->CW) */ LinearRing reverseRing(LinearRing lr) { int numPoints = lr.getNumPoints(); Coordinate[] newCoords = new Coordinate[numPoints]; for (int t = 0; t < numPoints; t++) { newCoords[t] = lr.getCoordinateN(numPoints - t - 1); } return new LinearRing(newCoords, new PrecisionModel(), 0); }