The need to calculate the size of earth
was first felt when the Abbasid Caliphate spread far and wide from Spain till Indus river in modern day Pakistan.
Muslims are required to pray facing the direction of the Kaaba and being far from Kaaba does not spares one from this obligation. So no matter how far Muslims were from the Kaaba they needed to determine its exact direction to pray. To do this accurately they needed to know the curvature of the earth and knowing this demanded that they know the size of the earth. By the way the Caliph was also curious to know the size of his empire!