public static Polygon removeCoordinates(Polygon poly) {
        Coordinate[] shellCoords = CoordinateUtils.removeDuplicatedCoordinates(poly.getExteriorRing().getCoordinates(),true);
        LinearRing shell = FACTORY.createLinearRing(shellCoords);
        ArrayList<LinearRing> holes = new ArrayList<LinearRing>();
        for (int i = 0; i < poly.getNumInteriorRing(); i++) {
            Coordinate[] holeCoords = CoordinateUtils.removeDuplicatedCoordinates(poly.getInteriorRingN(i).getCoordinates(),true);
            holes.add(FACTORY.createLinearRing(holeCoords));
        }
        return FACTORY.createPolygon(shell, GeometryFactory.toLinearRingArray(holes));
    }
public static Polygon removeCoordinates ( Polygon poly ) { Coordinate [ ] shellCoords = CoordinateUtils . removeDuplicatedCoordinates ( poly . getExteriorRing ( ) . getCoordinates ( ) , true ) ; LinearRing shell = FACTORY . createLinearRing ( shellCoords ) ; ArrayList < LinearRing > holes = new ArrayList < LinearRing > ( ) ; for ( int i = 0 ; i < poly . getNumInteriorRing ( ) ; i ++ ) { Coordinate [ ] holeCoords = CoordinateUtils . removeDuplicatedCoordinates ( poly . getInteriorRingN ( i ) . getCoordinates ( ) , true ) ; holes . add ( FACTORY . createLinearRing ( holeCoords ) ) ; } return FACTORY . createPolygon ( shell , GeometryFactory . toLinearRingArray ( holes ) ) ; }
Removes duplicated coordinates within a Polygon.

@param poly
@return