private SurfacePatch transform( GriddedSurfacePatch patch, Transformation trans ) throws TransformationException { GriddedSurfaceType type = patch.getGriddedSurfaceType(); GriddedSurfacePatch result = null; List<Points> rows = patch.getRows(); if ( rows != null && !rows.isEmpty() ) { List<Points> tRows = new ArrayList<Points>( rows.size() ); for ( Points row : rows ) { Points tRow = transform( row, trans ); if ( tRow != null ) { tRows.add( tRow ); } } switch ( type ) { case CONE: result = geomFactory.createCone( tRows ); break; case CYLINDER: result = geomFactory.createCylinder( tRows ); break; case GRIDDED_SURFACE_PATCH: result = geomFactory.createGriddedSurfacePatch( tRows ); break; case SPHERE: result = geomFactory.createSphere( tRows ); break; } } return result; }