In this paper, a novel algorithm of weighted k-means clustering with geodesic criteria is presented to generate a uniform database for a star sensor. For this purpose, selecting the appropriate star catalogue and desirable minimum magnitude and eliminating double stars are among the steps of the uniformity process. Further, Delaunay triangulation and determining the scattered data density by using a Voronoi diagram were used to solve the problems of the proposed clustering method. Thus, by running a Monte Carlo simulation to count the number of stars observed in different fields of view, it was found that the uniformity leads to a significant reduction of the probability of observing a large number of stars in all fields of view. In contrast, the uniformity slightly increased the field of view needed to observe the minimum number of required stars for an identification algorithm.