I used to sell store locator software and this is always a problem. We worked on allowing “masks” over water that basically added a penalty for any vector that passed over the mask. It’s a hard problem at any kind of scale though and even this solution wasn’t perfect (imagine a river with no bridges or ferries only)