Before Beis Din can perform the eglah arufa ceremony they must measure the distance from the murder victim's body to the nearby cities. Rashi (21:2) explains that the purpose of the measurement is to determine which city is closest. However, this explanation seems to contradict the gemara (Sotah 45) which states that even if the body is found right outside a city, the measurement must still be done -- even if which city is closest is obvious there is a mitzvah to measure.
How to understand this halacha of measurement is perhaps a dispute between the Rambam and Tosfos. Tosfos (Baba Basra 23b d"h bdleika) cites the halacha that we only measure to a cities which have a Beis Din. Asks Tosfos: if the purpose of measurement is to determine where the victim came from, why would we overlook the closest city just because it lacks a Beis Din? Tosfos leaves the question unresolved. It seems that Tosfos, like Rashi, held that the measurement was done for the purpose of birur, discovering which city was closest.
The context of Tos. question is a sugya in Baba Basra (23) which discusses whether rov or kurva (proximity) is better proof. The gemara challenges R' Chanina's view that rov is stronger from the fact that we measure distances and choose the closest city despite that fact that rov of the world does not live in any of the nearby cities. The gemara dismisses this proof and writes that the measurements are done when the cities are isolated from the rest of the world by mountains. However, when the Rambam cites this halacha of measurement (Rotzeiach 9:6), he omits to mention that it holds true only where the cities are isolated from an interfering rov. Apparently the Rambam held that even given the possibility that the victim came from some outside rov, there is still a mitzvah to measure to the closest city. According to the Rambam, measurement is not done to determine where the victim came from, but is simply a hanhaga, a necessary step in the eglah arufa process that has no bearing on discovering evidence. We might even go a step further and suggest that the Rambam felt free to ignore the conclusion of the sugya in Baba Basra because he read the the sugya in Sotah which demands measurement even if the closest city is obvious as proof that measurement cannot be for the purpose of birur.
For more on the issue of whether measurement is a birur or hanhaga take a peek at the sources collected in my BIL's sefer Bigdei Sheish on Baba Basra . Assuming the lomdus is correct, I think in part II of this post (to come sometime bl"n in the near future) we need to explore what possible purpose this hanhaga of measurement might have. Is there any reason for Beis Din to personally have to go out (Sotah 45 also tells us this cannot be done through shluchim) to take measurements that will tell us nothing about the murder victim or his attacker?