[GIS] New to ArcGIS and want to compute distance between two points “as the fish swims”

arcgis-10.1arcgis-explorerarcgis-servercdistance

We have a layer named Hydrography which is the water area for a given assignment.
I have a station point and a target point. I need to compute the distance between those two points but inside of the hydrography. (boats cannot go over land)

The DefenseService distance computation looks passable but it seems to be in a straight line since it does not take any Raster as input. The Euclidean seems to almost be there but I cannot find anything that is straight forward.

I am using ArcGIS Explorer 2500, ArcGIS for Server 10.1 SP1 Enterprise, and we are writing our services and tools in C#.

I have the loading of the hydrography, the creation of the IPoints, but at a loss as to what to do next!

Any help appreciated, please.

Best Answer

Use the Cost Distance and Cost Path Tools from the Spatial Analyst Extension.

You can create a Raster from your Hydrography Polygons. Then assure that the raster cells that represent water get a low value (e.g. 1) and the other raster cells get a high value (e.g. 1000). You can then use this raster as cost distance raster in the Cost Path Tool.