In the process of navigation and positioning, one of the factors affecting the positioning accuracy is the spatial geometric distribution of the satellite. It is very important to select the satellite with a good spatial distribution. For the traditional satellite selection algorithm based on azimuth Angle and pitch Angle, Because in the satellite selection process, the first lowest satellite is forced to add a fixed angle as a criterion for satellite selection,the satellite selection in the area with dense satellite distribution is more concentrated, which is not conducive to positioning. On the basis of calculating the azimuth and elevation, In this paper, a satellite selection algorithm based on hierarchical clustering is proposed.