The transmission line galloping poses a great challenge to the safe and stable operation of power grid. In order to alert transmission line galloping accurately, an early-warning method based on random forest (RF) is proposed in this paper. The input values include internal factors (i.e. conductor splitting number, diameter, spacing) and external factors (i.e. wind speed, wind direction angle, humidity). In addition, in view of the difficulties such as fewer galloping samples, a great difference in galloping terrain and a great difficulty in early-warning objectively, this paper proposes a weighted grey relation projection method in order to select historical data which is similar to the predicted terrain. The case analysis shows that the proposed model has obvious advantages in accuracy and false positive rate compared with the traditional random forest algorithm and BP neural network. This paper can provide a new solution for the early-warning of transmission line galloping.