  The metric-affine and generalized geometries, respectively, are arguably the
appropriate mathematical frameworks for Einstein's theory of gravity and the
low-energy effective massless oriented closed bosonic string field theory. In
fact, mathematical structures in a metric-affine geometry are written on the
tangent bundle, which is itself a Lie algebroid; whereas those in generalized
geometries introduced as the basis of double field theories, are written on
Courant algebroids. The Lie, Courant and the higher Courant algebroids used in
exceptional field theories, are all special cases of pre-Leibniz algebroids.
Provided with some additional ingredients, the construction of such geometries
can all be carried over to regular pre-Leibniz algebroids. We define below the
notions of locality structures and locality projectors, which are some such
necessary ingredients. In terms of these structures, $E$-metric-connection
geometries are constructed with (possibly) a minimum number of assumptions.
Certain small gaps in the literature are also filled as we go along. $E$-Koszul
connections, as a generalization of Levi-Civita connections, are going to be
defined and shown to be helpful for some results including a simple
generalization of the fundamental theorem of Riemannian geometry. We also show
that metric-affine geometries can be constructed in a unique way as special
cases of $E$-metric-connection geometries. Moreover, generalized geometries are
shown to follow as special cases, and various properties of linear
generalized-connections are proven in the present framework. Similarly,
uniqueness of the locality projector in the case of exact Courant algebroids is
proven; a result that explains why the curvature operator, defined with a
projector in the double field theory literature is a necessity.
