The median of the distances is the middle value when the data is arranged in numerical order.
Arranging the distances in ascending order gives us: 0, 1, 2, 2, 3, 4, 4, 5, 5, 7, 8, 9
Since there are 12 values, the median will be the average of the 6th and 7th values, which are 4 and 4.
Therefore, the median of the distances is (4 + 4) / 2 = 4 kilometers.