Approximating boundaries of causative sources is an important task in potential field interpretation. Many techniques have been proposed for approximating the edges including derivative and phase-based methods. The derivative-based methods cannot equalize the signal amplitudes, and although the phase-based methods do not have this problem, they maybe produce false edges, or the obtained edges are diffused. To overcome these problems, the ridges of some edge detection functions can be determined using the algorithms such as the Blakely and Simpson's algorithm or the curvature analysis algorithm. However, these algorithms cannot fully identify all the peaks of the data or produce some spurious ridges in output maps. In this study, we introduce an improved method to locate the peaks of the data. The efficiency of the algorithm is demonstrated on two synthetic gravity data, as well as real gravity data of the Vredefort dome area (South Africa). Compared with two traditional methods, the proposed algorithm produces more precise and detailed results.