It is based on the non-stop distance, or as you say as the crow flies. However if it is not confimed all the way then you are out-of-luck and need to surrender for just a portion of the flight even if it is more than the non-stop.
For example - I often fly HNL-LAX-SFO and only give 2500 miles worth of coupons, since HNL-SFO is less than 2500, however if you add it all up you come up with close to 3000 miles, and the HNL-LAX part is already over 2500. But I usually always have to explain it to the check-in agent.