The high penetration of wind energy in electrical power systems presents challenges for all operators. For the wind farm (WF) planners, one of these challenges is optimizing its layout with a set of constraints. This paper proposes a bi-hierarchy optimization scheme to determine the capacity and layout of a grid-connected WF. The environmental impacts involved by the installation of a WF have been taken into consideration in the problem. The first-layer model optimizes the WF capacity and configuration with minimized comprehensive generation cost of wind energy and two sets of constraints. The sound pressure level (SPL) limit of the noise emitted by the wind turbines (WTs) is handled to be one of the constraints of the first-layer model. The second-layer model determines the generation schedule of other conventional generators. A Gaussian wake model is applied to calculate the effective wind speed for each WT. For the simulations, the WF is supposed to be integrated in the IEEE 30-bus test system. The wild goats algorithm (WGA) and the quadratic programming (QP) method are used to solve the problem. The simulation results validate the effectiveness of the proposed model and prove that environmental influences of WFs should not be ignored during the planning stage.