Measure of sets of geodesics in a riemannian space and applications to integral formulas in elliptic and hyperbolic spaces