To find the length of the base of the square pyramid, we will apply the Pythagorean theorem on the right triangle that is formed by the height, half the base length, and the slant height.
Let's denote:
- the height \( h = 20 \) miles,
- the slant height \( l = 25 \) miles,
- the half base length \( b/2 \) (where \( b \) is the full base length) as \( x \).
According to the Pythagorean theorem: \[ h^2 + \left(\frac{b}{2}\right)^2 = l^2 \]
Substituting the known values: \[ 20^2 + x^2 = 25^2 \] \[ 400 + x^2 = 625 \]
To find \( x^2 \): \[ x^2 = 625 - 400 \] \[ x^2 = 225 \]
Taking the square root to find \( x \): \[ x = \sqrt{225} = 15 \text{ miles} \]
Since \( x \) is half of the base, we can find the full base length \( b \): \[ b = 2x = 2(15) = 30 \text{ miles} \]
Therefore, the base length of the square pyramid is: \[ \boxed{30} \text{ miles} \]