Edge detection is an important processing method for potential field data, used to determine the horizontal location of the edges of causative sources. We proposed an edge detection filtering based on a gradient tensor ratio and improved the small subdomain filtering technique, and merged them into a tensor ratio small subdomain filtering technique. The proposed detection filter utilizes numerical differentiation and Laplace equation to compute gradient tensors. To weaken the interference of random noise on the small subdomain filtering and the irregular bending of contour lines in its result, we replace the original data at the center with a weighted average of the data within the window, where the weighting factors are determined by the distance of each data point to the center point and the standard deviation between equidistant data points. Final filtering output is the weighted average of the data within the subdomain that has the minimum standard deviation, wherein tighten gradient belts are utilized as indicators for detecting the edges of causative sources. Test results on synthetic data show that the proposed method has higher detection accuracy and stability compared to previous methods, and can enhance local anomalies. We also apply them to a real gravity data, and the obtain results indicate that the proposed method can effectively detect fault locations and highlight the residual density characteristics of causative sources.