public static Rectangle fromPolygon(Polygon[] polygons){
  double minLat=Double.POSITIVE_INFINITY;
  double maxLat=Double.NEGATIVE_INFINITY;
  double minLon=Double.POSITIVE_INFINITY;
  double maxLon=Double.NEGATIVE_INFINITY;
  for (int i=0; i < polygons.length; i++) {
    minLat=Math.min(polygons[i].minLat,minLat);
    maxLat=Math.max(polygons[i].maxLat,maxLat);
    minLon=Math.min(polygons[i].minLon,minLon);
    maxLon=Math.max(polygons[i].maxLon,maxLon);
  }
  return new Rectangle(minLat,maxLat,minLon,maxLon);
}

public static Rectangle fromPolygon ( Polygon [ ] polygons ) { double minLat = Double . POSITIVE_INFINITY ; double maxLat = Double . NEGATIVE_INFINITY ; double minLon = Double . POSITIVE_INFINITY ; double maxLon = Double . NEGATIVE_INFINITY ; for ( int i = 0 ; i < polygons . length ; i ++ ) { minLat = Math . min ( polygons [ i ] . minLat , minLat ) ; maxLat = Math . max ( polygons [ i ] . maxLat , maxLat ) ; minLon = Math . min ( polygons [ i ] . minLon , minLon ) ; maxLon = Math . max ( polygons [ i ] . maxLon , maxLon ) ; } return new Rectangle ( minLat , maxLat , minLon , maxLon ) ; }
returns the bounding box over an array of polygons
