Terrain feature extraction is one of the critical issues in geographic information science. As important terrain feature lines, ridge lines and valley lines, play an important role in hydrological analysis, terrain reconstruction and automatic integration of contour lines. But, the extraction of terrain feature lines is complicated and time-consuming task. In this paper, a terrain feature line extraction method is proposed based on clustering technique. The terrain feature points are automatically extracted according to the agglomeration of terrain points, and the similar points are automatically identi ed according to the DBSCAN clustering algorithm. The points with high similarity are clustered along the direction of ridge or valley, and the whole terrain will be clustered into multiple sub-regions. The nearest sub-regions are found by calculating the minimum distance between these sub-regions, and the adjacent sub-regions are connected orderly by their center line to obtain terrain feature lines. Compared with other methods, the cluster analysis method in this paper has simple process and high e ciency.