Extending the compact gravity inversion technique by incorporating a priori information about the maximum compactness of the anomalous sources along several axes provides versatility. Thus, the method may also incorporate information about limits in the axes lengths or greater concentration of mass along one or more directions. The judicious combination of different constraints on the anomalous mass distribution allows the introduction of several kinds of a priori information about the (arbitrary) shape of the sources. This method is particularly applicable to constant, linear density sources such as mineralizations along faults and intruded sills, dikes, and laccoliths in a sedimentary basin. The correct source density must be known with a maximum uncertainty of 40 percent; otherwise, the inversion produces thicker bodies for densities smaller than the true value and vice-versa. Because of the limitations of the inverse gravity problem, the proposed technique requires an empirical technique to analyze the sensitivity of solutions to uncertainties in the a priori information. The proposed technique is based on a finite number of acceptable solutions, presumably representative of the ambiguity region. By using standard statistical techniques, each parameter is assigned a coefficient measuring its uncertainty. The known hematite and magnetite ore body shape, in the vicinity of Iron Mountain, MO, was reproduced quite well using this inversion technique.