public PolygonTo toTransferObject(Polygon input) {
        PolygonTo result = new PolygonTo();
        result.setCrs(GeoJsonTo.createCrsTo("EPSG:" + input.getSRID()));
        double[][][] rings = new double[input.getNumInteriorRing() + 1][][];
        // Exterior ring:
        rings[0] = getPoints(input.getExteriorRing());
        // Interior rings!
        for (int i = 0; i < input.getNumInteriorRing(); i++) {
            rings[i + 1] = getPoints(input.getInteriorRingN(i));
        }
        result.setCoordinates(rings);
        return result;
    }
public PolygonTo toTransferObject ( Polygon input ) { PolygonTo result = new PolygonTo ( ) ; result . setCrs ( GeoJsonTo . createCrsTo ( "EPSG:" + input . getSRID ( ) ) ) ; double [ ] [ ] [ ] rings = new double [ input . getNumInteriorRing ( ) + 1 ] [ ] [ ] ; rings [ 0 ] = getPoints ( input . getExteriorRing ( ) ) ; for ( int i = 0 ; i < input . getNumInteriorRing ( ) ; i ++ ) { rings [ i + 1 ] = getPoints ( input . getInteriorRingN ( i ) ) ; } result . setCoordinates ( rings ) ; return result ; }
Converts a polygon to its corresponding Transfer Object

@param input a polygon object
@return a transfer object for the polygon