Add distance condition to using straight-line distance.