Can someone explain to me (in beginner's terms) how to calculate the distance between two points that are on water, avoiding land?

For example, these points are inshore in a bay, so I don't want the path to go over any of the bends in the coastline.

1 Answer 1


If you have Spatial Analyst, take a polygon that represents your water and convert it to a raster. Then you can use the "Cost Path" tool. If your only constraint is that you have to stay in the water, just make all the water cells have value of 1 when you create the raster. The land cells should have a value of NODATA, and I'm pretty sure the cost path will not be allowed to go through those cells. (If I'm wrong, then you'll want a raster where the water cell value is 1 and the land is some very large number.)

I can't think of a way to do it without Spatial Analyst.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.